Django Commands: python manage.py syncdb

By: Dusty Arlia
Published on Monday, February 3, 2014, 07:35 PM
Last Updated on Tuesday, July 14, 2015 at 3:46 PM
Total Updates: 4

The python manage.py syncdb command runs the SQL from the python manage.py sqlall your_app command on your database for all apps in INSTALLED_APPS that don’t already exist in your database. syncdb looks at the INSTALLED_APPS setting in your_project/settings.py and creates any necessary database tables using your database settings in your_project/settings.py. The syncdb command will only create tables for apps in INSTALLED_APPS.

The syncdb command creates all the tables, initial data, and indexes for any apps you’ve added to your project since the last time you ran syncdb. Call the syncdb command as often as you want, it will only create the tables that don’t already exist.

For each database table it creates, you'll get an output message and at the end you'll get a prompt asking you if you'd like to create a superuser account for the authentication system.

Comments:

Ad:

Ad: