user3041020
user3041020

Reputation: 141

Django python manage.py migrate

I have installed on Win7 portable Python 2.7.5.1 and Django 1.6.

I followed the first polls tutorial instructions and got an error in the migrate stage, python manage.py migrate:

C:\Natan\Dev\Portable Python 2.7.5.1\App\Scripts\mysite>..\..\python.exe manage.py migrate
Unknown command: 'migrate'
Type 'manage.py help' for usage.

Any idea?

Upvotes: 14

Views: 34506

Answers (6)

Vineet Jain
Vineet Jain

Reputation: 1575

If you are using Django older versions before 1.7 then you should sync database by
python manage.py syncdb
while in new versions after 1.7 syncdb is replaced by migration. So for syncdb in new django version is replaced by :-
python manage.py makemigrations python manage.py migrate
for more type:-
python manage.py help

Upvotes: 0

Mike Bolívar
Mike Bolívar

Reputation: 81

First Step, Install South:

pip install south

Second Step, Add South to INSTALLED APPS in settings

INSTALLED_APPS = ( ..., 'south' )

Upvotes: 8

R Claven
R Claven

Reputation: 1210

All-

This is likely caused largely by following the 1.7 (DEV version!) tutorial when we all get the last stable version (1.6!) installed by pip.

It would not appear migrate is even a part of 1.7 in general! Will:

python manage.py syncdb

Solve your problems?

So pls either follow the tutorial for the last stable version of django: https://docs.djangoproject.com/en/1.6/intro/tutorial01/

Or follow the instructions to install the dev version of Django.

Dear Django team, You guys are awesome. The JS developer is very impressed. But PLEASE resolve the discrepancy above. Maybe default to 1.6 docs and put in red letters: Dev version here?

Thank you.

Upvotes: 4

OBu
OBu

Reputation: 5187

Migrate will be a native command in 1.7 (which is the version you read the tutorial pages from).

For older versions, you'll have to install the third party app"South".

Upvotes: 4

Mounir
Mounir

Reputation: 11746

You must install South to add migrate command.

pip install south

Upvotes: 3

Daniel Roseman
Daniel Roseman

Reputation: 600041

If you've installed 1.6, you should use the 1.6 tutorial, not the one for the development version.

Upvotes: 17

Related Questions