mirror of
https://github.com/django/django.git
synced 2025-03-31 19:46:42 +00:00
Fixed #22129 -- Added steps for creating superusers to tutorial.
This commit is contained in:
parent
72b080c2c8
commit
2f25cdc18a
@ -273,12 +273,41 @@ and creates any necessary database tables according to the database settings
|
|||||||
in your :file:`mysite/settings.py` file and the database migrations shipped
|
in your :file:`mysite/settings.py` file and the database migrations shipped
|
||||||
with the app (we'll cover those later). You'll see a message for each
|
with the app (we'll cover those later). You'll see a message for each
|
||||||
migration it applies, and you'll get a prompt asking you if you'd like to
|
migration it applies, and you'll get a prompt asking you if you'd like to
|
||||||
create a superuser account for the authentication system. Go ahead and do
|
create a superuser account for the authentication system.
|
||||||
that.
|
|
||||||
|
|
||||||
If you're interested, run the command-line client for your database and type
|
First, you'll be asked if you would like to create a superuser. Type the word
|
||||||
``\dt`` (PostgreSQL), ``SHOW TABLES;`` (MySQL), or ``.schema`` (SQLite) to
|
``yes`` and hit enter.
|
||||||
display the tables Django created.
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
You have installed Django's auth system, and don't have any superusers defined.
|
||||||
|
Would you like to create one now? (yes/no): yes
|
||||||
|
|
||||||
|
Next, enter a username. By default, this will be your system username. Enter
|
||||||
|
your desired username and press enter.
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
Username (leave blank to use 'your_username'): admin
|
||||||
|
|
||||||
|
You will then be prompted for your desired email address:
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
Email address: admin@example.com
|
||||||
|
|
||||||
|
The final step is to enter your password. You will be asked to enter your
|
||||||
|
password twice, the second time as a confirmation of the first.
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
Password: **********
|
||||||
|
Password (again): *********
|
||||||
|
Superuser created successfully.
|
||||||
|
|
||||||
|
With that done, if you're interested, run the command-line client for your
|
||||||
|
database and type ``\dt`` (PostgreSQL), ``SHOW TABLES;`` (MySQL), or
|
||||||
|
``.schema`` (SQLite) to display the tables Django created.
|
||||||
|
|
||||||
.. admonition:: For the minimalists
|
.. admonition:: For the minimalists
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user