Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 378
user3041020 Avatar asked Nov 27 '13 09:11

user3041020


People also ask

What does Django manage py migrate do?

migrate executes those SQL commands in the database file. So after executing migrate all the tables of your installed apps are created in your database file. You can confirm this by installing SQLite browser and opening db.

How do I run python manage py migrate?

Create or update a model. Run ./manage.py makemigrations <app_name> Run ./manage.py migrate to migrate everything or ./manage.py migrate <app_name> to migrate an individual app. Repeat as necessary.

What is the difference between Makemigrations and migrate in Django?

makemigrations is responsible for packaging up your model changes into individual migration files - analogous to commits - and migrate is responsible for applying those to your database.


2 Answers

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

like image 61
Daniel Roseman Avatar answered Oct 02 '22 08:10

Daniel Roseman


First Step, Install South:

pip install south

Second Step, Add South to INSTALLED APPS in settings

INSTALLED_APPS = ( ..., 'south' )

like image 40
Mike Bolívar Avatar answered Oct 02 '22 07:10

Mike Bolívar