6. TIPS
Projects vs. apps
A project can contain multiple apps.
An app can be in multiple projects.
Philosophy
A model is the single, definitive source of data about your
data.
It contains the essential fields and behaviors of the data
you're storing.
Django follows the DRY Principle.
The goal is to define your data model in one place and
automatically derive things from it.
6/20
7. Activating models
Create a database schema
(CREATE TABLE statements) for this app.
Create a Python database-access API for
accessing Poll and Choice objects.
settings.py: INSTALLED_APPS 加
上 'mysite.polls'
python manage.py sql polls
python manage.py syncdb
7/20