Execute manage.py syncdb prompt unknown command: ' syncdb '

Source: Internet
Author: User

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 '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.