1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

[soc2009/model-validation] Merget to trunk at r12009

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@12014 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Honza Král
2009-12-28 16:35:23 +00:00
parent 695de8cc91
commit f911df19a4
556 changed files with 22622 additions and 9561 deletions

View File

@@ -102,7 +102,7 @@ These files are:
contents" of your Django-powered site. You can read more about URLs in
:ref:`topics-http-urls`.
.. _more about packages: http://docs.python.org/tut/node8.html#packages
.. _more about packages: http://docs.python.org/tutorial/modules.html#packages
The development server
----------------------
@@ -158,34 +158,40 @@ It worked!
Database setup
--------------
Now, edit :file:`settings.py`. It's a normal Python module with module-level
variables representing Django settings. Change these settings to match your
database's connection parameters:
Now, edit :file:`settings.py`. It's a normal Python module with
module-level variables representing Django settings. Change the
following keys in the :setting:`DATABASES` ``'default'`` item to match
your databases connection settings.
* :setting:`DATABASE_ENGINE` -- Either 'postgresql_psycopg2', 'mysql' or
'sqlite3'. Other backends are :setting:`also available <DATABASE_ENGINE>`.
* :setting:`ENGINE` -- Either
``'django.db.backends.postgresql_psycopg2'``,
``'django.db.backends.mysql'`` or
``'django.db.backends.sqlite3'``. Other backends are
:setting:`also available <ENGINE>`.
* :setting:`DATABASE_NAME` -- The name of your database. If you're using
SQLite, the database will be a file on your computer; in that case,
``DATABASE_NAME`` should be the full absolute path, including filename, of
that file. If the file doesn't exist, it will automatically be created
when you synchronize the database for the first time (see below).
* :setting:`NAME` -- The name of your database. If you're using
SQLite, the database will be a file on your computer; in that
case, :setting:`NAME` should be the full absolute path,
including filename, of that file. If the file doesn't exist, it
will automatically be created when you synchronize the database
for the first time (see below).
When specifying the path, always use forward slashes, even on Windows
(e.g. ``C:/homes/user/mysite/sqlite3.db``).
When specifying the path, always use forward slashes, even on
Windows (e.g. ``C:/homes/user/mysite/sqlite3.db``).
* :setting:`DATABASE_USER` -- Your database username (not used for SQLite).
* :setting:`USER` -- Your database username (not used for SQLite).
* :setting:`DATABASE_PASSWORD` -- Your database password (not used for
* :setting:`PASSWORD` -- Your database password (not used for
SQLite).
* :setting:`DATABASE_HOST` -- The host your database is on. Leave this as an
empty string if your database server is on the same physical machine (not
used for SQLite).
* :setting:`HOST` -- The host your database is on. Leave this as
an empty string if your database server is on the same physical
machine (not used for SQLite).
If you're new to databases, we recommend simply using SQLite (by setting
:setting:`DATABASE_ENGINE` to ``'sqlite3'``). SQLite is included as part of
Python 2.5 and later, so you won't need to install anything else.
If you're new to databases, we recommend simply using SQLite (by
setting :setting:`ENGINE` to ``'django.db.backends.sqlite3'``). SQLite
is included as part of Python 2.5 and later, so you won't need to
install anything else.
.. note::
@@ -361,7 +367,7 @@ Finally, note a relationship is defined, using
to a single Poll. Django supports all the common database relationships:
many-to-ones, many-to-manys and one-to-ones.
.. _`Python path`: http://docs.python.org/tut/node8.html#SECTION008110000000000000000
.. _`Python path`: http://docs.python.org/tutorial/modules.html#the-module-search-path
Activating models
=================