36

I want to create the tables of one database called "database1.sqlite", so I run the command:

python manage.py syncdb

but when I execute the command I receive the following error:

Unknown command: 'syncdb' Type 'manage.py help' for usage.

But when I run

manage.py help

I don`t see any command suspicious to substitute

python manage.py syncdb

Version of Python I use: 3.4.2 Version of Django I use:1.9

I would be very grateful if somebody could help me to solve this issue.

Regards and thanks in advance

4
  • 1
    Seems like you are a bit ahead of time maybe? :p Isn't django 1.8 in alpha? Commented Feb 24, 2015 at 0:06
  • have you tried python manage.py migrate docs Commented Feb 24, 2015 at 0:16
  • Gracias por su apoyo. Su resuelto @Archi --> I installed the beta version 1.9. As I am using a videotutorial to learn Django I have decided to install the same version the videotutorial is using the 1.6.2 one. Commented Feb 24, 2015 at 11:35
  • A small discussion can be found here stackoverflow.com/questions/21402649/… Commented Sep 23, 2017 at 4:03

10 Answers 10

62

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

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your support. Solved @Archi --> I installed the beta version 1.9. As I am using a videotutorial to learn Django I have decided to install the same version the videotutorial is using the 1.6.2 one.
how to load fixtures? before that it was very comfortable
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"

Comments

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.

1 Comment

and what about fixture loading? it was very comfy with one command
2

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.

Comments

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.

Comments

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

Comments

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

Comments

0

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

Comments

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.

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.