52๐
I think you want to run these commands:
python manage.py makemigrations
creates migration files based on your models
python manage.py migrate
will create the tables in your db based on the migration files created
(see docs for more details on database migrations)
python manage.py createsuperuser
will create a superuser for your application in the database (docs)
- [Django]-Why does Django make migrations for help_text and verbose_name changes?
- [Django]-Django fix Admin plural
- [Django]-Django check to see if field is blank?
4๐
For Django 2
User.objects.create_superuser(username='name',email='email',password='password')
From the docs
create_superuser(username, email, password, **extra_fields)
Same as create_user(), but sets is_staff and is_superuser to True.
Which can be embedded in a script, called from a command line or triggered via an API
- [Django]-Using a string as the argument to a Django filter query
- [Django]-Where's my JSON data in my incoming Django request?
- [Django]-Is virtualenv recommended for django production server?
3๐
first run
$ django-admin startproject mysite
in cmd prompt,then apply migration by
cd mysite
mysite:
python manage.py makemigrations
then
python manage.py migrate
after that
python manage.py createsuperuser
- [Django]-Getting the SQL from a Django QuerySet
- [Django]-How to return a static HTML file as a response in Django?
- [Django]-Django Admin CSS missing
3๐
First weโll need to create a user who can login to the admin site. Run
the following command:
$ python manage.py createsuperuser
Enter your desired username and press enter. Username: admin
You will then be prompted for your desired email address:
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.
Password: **********
Password (again): *********
Superuser created successfully.
- [Django]-Extending Django Admin Templates โ altering change list
- [Django]-How to start doing TDD in a django project?
- [Django]-Why do we need to use rabbitmq
1๐
$ python manage.py createsuperuser
It will ask username and password
http://127.0.0.1:8000/admin/
see
https://www.tutorialshore.com/create-new-admin-user-in-django/
- [Django]-How do I run tests against a Django data migration?
- [Django]-Django Selective Dumpdata
- [Django]-Modifying Dictionary in Django Session Does Not Modify Session
0๐
you create superuser with this :
python manage.py createsuperuser
this will create superuser for you and you can create many superuser .
but notice before you can make super user you must run these command :
python manage.py makemigrations
and them :
python manage.py migrate
- [Django]-Why is using thread locals in Django bad?
- [Django]-How are Django channels different than celery?
- [Django]-How to render Django forms.ChoiceField as Twitter Bootstrap dropdown