I am reading a book ("Learning Django Web Development" by Sanjeev Jaiswal and Ratan Kumar) on Django, but the book is based on an earlier version of Django (prior to version 1.9). In order to populate the database with tables, the book uses the syncdb command:
$ python manage.py syncdb
Then the book says that terminal will prompt you to create a superuser account.
the syncdb command is no longer used in Django version 1.9 and up. After some research, it seems as if the migrate command populates the databse with tables, but it does not prompt the creation of a superuser account. How can I do this in Django 1.9.6?
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)
$ python manage.py migrate $ python manage.py createsuperuser
https://docs.djangoproject.com/en/1.9/ref/django-admin/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With