$ python manage.py syncdb

is for sync of your models to your database.

It looks all of the models in each app in INSTALLED_APPS setting,

checks the database to see whether the appropriate table exist yet or not.

If not, create the tables.

Note that syncdb does not sync changes in models or deletions of models. That is, if you make a change to a model or delete a model, syncdb can’t handle it.

$ python manage.py sqlall yourappname

prints out all the database tables associated with yourapp.

Note that it is not actually create the tables.

To commit, use

$ python manage.py syncdb

$ python manage.py validate

checks whether the models’ syntax and logic are correct or not.

$python manage.py startapp yourappname

This will create

1. directory named yourappname

2. files:

__init__.py

models.py

views.py

After creating django project,

$python manage.py syncdb

needs to be executed.

The syncdb command

1. creates the necessary database tables,

2. creates permission objects for all installed apps that need them,

3. prompts you to create a superuser account the first time you run it.

© 2011 Web Oom Suffusion theme by Sayontan Sinha
Switch to our mobile site
Top Footer