1. Experimental environment
ubuntu14.4 + django1.9.7
2. Description of the problem
After you configure the database mysite/settings.py, you typically need to run
Python manage.py syncdb
Establish a database table for each application in the database.
However, if you install the Django Version >= 1.9, the following problems will occur:
[Email protected]:~/django_try/mysite$ python manage.py syncdbunknown command: ' syncdb ' Type ' manage.py help ' for [email p rotected]:~/django_try/mysite$ python manage.py syncdbpython manage.py syncdbunknown command: ' Syncdbpython ' Type ' manage.py help ' for usage.
3. Workaround
Find the cause and workaround on StackOverflow:
SYNCDB is deprecated because of the migration system.
Now you can log your changes using Makemigrations. This transforms your model changes into Python code to make them deployable to another databases.
After your created the migrations you has to apply them:migrate.
So instead of using syncdb you should use makemigrations and then migrate.
In short: The Django 1.9 and future versions use migrate instead of SYSCDB.
./manage.py Migrate
Execute manage.py syncdb prompt unknown command: ' syncdb '