Unknown command: 'syncdb' Visual Studio 2013

Asked

Viewed 295 times

1

I’m having trouble developing a system in Django. When I try to synchronize the bank this error appears:

Python interactive window. Type $help for a list of commands.
Executing manage.py syncdb
Unknown command: 'syncdb'
Type 'manage.py help' for usage.
The Python REPL process has exited

inserir a descrição da imagem aqui

2 answers

2


If you are using Django 1.9, syncdb has been removed, see the release:

https://docs.djangoproject.com/en/1.9/releases/1.9/#Features-Removed-in-1-9

To run migrations, you must use makemigrations and migrate.

Created or changed table:

python manage.py makemigrations
#Irá criar arquivos de migrações com as coisas que você fez

Perform migrations:

python manage.py migrate
#Irá aplicar as alterações no banco.
  • Correct. I’m using Django 1.9! I didn’t know this "detail"

  • I must use this command in visual studio ??

  • Good guy, particularly I don’t like windows. But the root of the problem was this. Starting from Django 1.7, the camandos to make and execute the migrations are these two. There was syncdb until 1.8 Did you try to run these commands? Gave any problem?

  • executed yes...

  • I found your Solution but I don’t know Where should I type the Commands, Please guide me: python Manage. py makemigrations # will create Migration files with the Things you’ve done Run Migration: python Manage. py migrate

0

Alex, Dias is correct. The syncdb command has been discontinued. In its place I use the 2 commands below and exactly in this sequence, not to have problems with the Django Admin BD:

python manage.py migrate auth python manage.py migrate --run-syncdb

  • Use the field comentar when not responding.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.