[Django]-"Unknown command syncdb" running "python manage.py syncdb"

60👍

If you look at the release notes for django 1.9, syncdb command is removed.

Please use migrate instead. Moving forward, the migration commands would be as documented here

Please note that the django-1.9 release is not stable as of today.

Edit: Django 1.9 is stable now

8👍

the new django 1.9 has removed “syncdb”,
run “python manage.py migrate”,
if you are trying to create a super user, run “python manage.py createsuperuser”

7👍

$python manage.py syncdb is deprecated and not supported now.
So instead of this follow below instructions..

Whatever model you have created:
First run:

$python manage.py makemigrations

After running this command you model will be reflected in a migration.

Then you have to run:

$python manage.py migrate

Then run server:

$python manage.py runserver

Now, your project will run perfectly.

2👍

In Django 1.9 onwards syncdb command is removed. So instead of use that one, you can use migrate command,eg: python manage.py migrate.Then you can run your server by python manage.py runserver command.

1👍

Django has removed python manage.py syncdb command now you can simply use python manage.py makemigrations followed bypython manage.py migrate. The database will sync automatically.

1👍

I had the same problem, the only thing worked for me was this command.

python3 manage.py migrate --run-syncdb

Running this got me this result.

Ranvijays-Mac:djangodemo rana.singh$ python3 manage.py migrate --run-syncdb
Operations to perform:
  Synchronize unmigrated apps: messages, staticfiles
  Apply all migrations: admin, auth, contenttypes, msg, sessions
Synchronizing apps without migrations:
  Creating tables...
    Running deferred SQL...
Running migrations:
  Applying msg.0001_initial... OK

0👍

You can run the command from the project folder as: “python.exe manage.py migrate“, from a commandline or in a batch-file.
You could also downgrade Django to an older version (before 1.9) if you really need syncdb.

For people trying to run Syncdb from Visual Studio 2015:
The option syncdb was removed from Django 1.9 (deprecated from 1.7), but this option is currently not updated in the context menu of VS2015.

Also, in case you didn’t get asked to create a superuser you should manually run this command to create one: python.exe manage.py createsuperuser

👤Daan

0👍

Run the command python manage.py makemigratons,and than python manage.py migrate to sync.

👤cwjwhu

0👍

Alternarte Way:

  1. Uninstall Django Module from environment
  2. Edit Requirements.txt a type Django<1.9
  3. Run Install from Requirments option in the enviroment
  4. Try Syncdb again

This worked for me.

0👍

I also tried this command. Lastly I found the release note from django

Features removed in 1.9

The syncdb command is removed.

Djnago Releases note 1.9

enter image description here

Leave a comment