mirror of https://github.com/django/django.git
Fixed #3858 -- Updated pieces of tutorial 1 to reflect recent changes. Thanks to Kashif Razzaqui for the report, and Simon for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4846 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4a6c7e75c2
commit
4dab533f7e
|
@ -133,8 +133,8 @@ Now, edit ``settings.py``. It's a normal Python module with module-level
|
||||||
variables representing Django settings. Change these settings to match your
|
variables representing Django settings. Change these settings to match your
|
||||||
database's connection parameters:
|
database's connection parameters:
|
||||||
|
|
||||||
* ``DATABASE_ENGINE`` -- Either 'postgresql', 'mysql' or 'sqlite3'.
|
* ``DATABASE_ENGINE`` -- Either 'postgresql_psycopg2', 'mysql' or 'sqlite3'.
|
||||||
More coming soon.
|
Other backends are `also available`_.
|
||||||
* ``DATABASE_NAME`` -- The name of your database, or the full (absolute)
|
* ``DATABASE_NAME`` -- The name of your database, or the full (absolute)
|
||||||
path to the database file if you're using SQLite.
|
path to the database file if you're using SQLite.
|
||||||
* ``DATABASE_USER`` -- Your database username (not used for SQLite).
|
* ``DATABASE_USER`` -- Your database username (not used for SQLite).
|
||||||
|
@ -143,6 +143,8 @@ database's connection parameters:
|
||||||
empty string if your database server is on the same physical machine
|
empty string if your database server is on the same physical machine
|
||||||
(not used for SQLite).
|
(not used for SQLite).
|
||||||
|
|
||||||
|
.. _also available: ../settings/
|
||||||
|
|
||||||
.. admonition:: Note
|
.. admonition:: Note
|
||||||
|
|
||||||
If you're using PostgreSQL or MySQL, make sure you've created a database by
|
If you're using PostgreSQL or MySQL, make sure you've created a database by
|
||||||
|
@ -319,7 +321,8 @@ Now Django knows ``mysite`` includes the ``polls`` app. Let's run another comman
|
||||||
|
|
||||||
python manage.py sql polls
|
python manage.py sql polls
|
||||||
|
|
||||||
You should see the following (the CREATE TABLE SQL statements for the polls app)::
|
You should see something similar to the following (the CREATE TABLE SQL statements
|
||||||
|
for the polls app)::
|
||||||
|
|
||||||
BEGIN;
|
BEGIN;
|
||||||
CREATE TABLE "polls_poll" (
|
CREATE TABLE "polls_poll" (
|
||||||
|
@ -337,6 +340,8 @@ You should see the following (the CREATE TABLE SQL statements for the polls app)
|
||||||
|
|
||||||
Note the following:
|
Note the following:
|
||||||
|
|
||||||
|
* The exact output will vary depending on the database you are using.
|
||||||
|
|
||||||
* Table names are automatically generated by combining the name of the app
|
* Table names are automatically generated by combining the name of the app
|
||||||
(``polls``) and the lowercase name of the model -- ``poll`` and
|
(``polls``) and the lowercase name of the model -- ``poll`` and
|
||||||
``choice``. (You can override this behavior.)
|
``choice``. (You can override this behavior.)
|
||||||
|
@ -365,8 +370,9 @@ If you're interested, also run the following commands:
|
||||||
* ``python manage.py validate polls`` -- Checks for any errors in the
|
* ``python manage.py validate polls`` -- Checks for any errors in the
|
||||||
construction of your models.
|
construction of your models.
|
||||||
|
|
||||||
* ``python manage.py sqlinitialdata polls`` -- Outputs any initial data
|
* ``python manage.py sqlcustom polls`` -- Outputs any custom SQL statements
|
||||||
required for Django's admin framework and your models.
|
(such as table modifications or constraints) that are defined for the
|
||||||
|
application.
|
||||||
|
|
||||||
* ``python manage.py sqlclear polls`` -- Outputs the necessary ``DROP
|
* ``python manage.py sqlclear polls`` -- Outputs the necessary ``DROP
|
||||||
TABLE`` statements for this app, according to which tables already exist
|
TABLE`` statements for this app, according to which tables already exist
|
||||||
|
|
Loading…
Reference in New Issue