Main point is that you: - save your current database tables structure - change your model tables - scan for differences and create script - then write changes to your database with automatically generated python script. It is meant to change old one and quite simple command 'syncdb' someday. Use pip/easy_install script or simply put 'south' dir to your project root dir. For now go get yourself this tool and learn to use it. For details on how to use Django Evolution, read the tutorial/instructions contained in docs/
The Chinook project provides a sample reference database in various database formats - think a new version of the old Northwind reference database.
I downloaded the Sqlite version for our project from the Chinook project website and dropped it in my new (django1.3)$ cd dualdb/ (django1.3)$ chmod u x (django1.3)$ ./startapp chinook (django1.3)$ ls -l chinook total 12 -rw-rw-r-- 1 simeon simeon 0 Aug 1 __init__-rw-rw-r-- 1 simeon simeon 57 Aug 1 -rw-rw-r-- 1 simeon simeon 383 Aug 1 -rw-rw-r-- 1 simeon simeon 26 Aug 1 We need two databases: one for django.models and any other custom models we may have and one which is a legacy database whose creation/alteration we won't be managing with Django. Basically we need to configure our settings to know about both our databases and then optionally build a database router that determines how data in particular apps and models ends up in a particular database. I always add a new variable to calculate the absolute path of my project directory.
Note that Django doesn’t support primary keys consisting of multiple columns.
For example, in our beer drinkers’ database, Django doesn’t allow (beer, drinker) to be key of Frequents; instead, it creates a surrogate id for Frequents.
As you interact with the website, you will see various information and/error messages in the VM shell.
To stop the website, simply type in the Django site directory to make sure that the database tables are consistent with your apps.
If you want to run Django in a real production setting, we recommend using Django with Apache and During this process, you will be prompt to create a superuser for Django’s auth (authentication) system, which you can use to manage your site through a Web interface; answer “yes” to create one.
Later, you might also be prompted to confirm the overwriting of all static files; just answer “yes” to continue.
Hi there guys and we're here to talk about migrations today. Just in case add some field to your django model like bollean or text and/or edit your existing field rather by adding 'null=True' for e.g.