summaryrefslogtreecommitdiff
path: root/docs/tutorial01.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorial01.txt')
-rw-r--r--docs/tutorial01.txt44
1 files changed, 33 insertions, 11 deletions
diff --git a/docs/tutorial01.txt b/docs/tutorial01.txt
index 1113b603da..c40b051b19 100644
--- a/docs/tutorial01.txt
+++ b/docs/tutorial01.txt
@@ -17,7 +17,16 @@ installed by running the Python interactive interpreter and typing
``import django``. If that command runs successfully, with no errors, Django is
installed.
-.. _`Django installed`: http://www.djangoproject.com/documentation/install/
+.. _`Django installed`: ../install/
+
+.. admonition:: Where to get help:
+
+ If you're having trouble going through this tutorial, please post a message
+ to `django-users`_ or drop by `#django`_ on ``irc.freenode.net`` and we'll
+ try to help.
+
+.. _django-users: http://groups.google.com/group/django-users
+.. _#django: irc://irc.freenode.net/django
Creating a project
==================
@@ -32,6 +41,13 @@ From the command line, ``cd`` into a directory where you'd like to store your
code, then run the command ``django-admin.py startproject mysite``. This
will create a ``mysite`` directory in your current directory.
+.. note::
+
+ You'll need to avoid naming projects after built-in Python or Django
+ components. In particular, this means you should avoid using names like
+ ``django`` (which will conflict with Django itself) or ``site`` (which
+ conflicts with a built-in Python package).
+
(``django-admin.py`` should be on your system path if you installed Django via
``python setup.py``. If it's not on your path, you can find it in
``site-packages/django/bin``, where ``site-packages`` is a directory within
@@ -108,7 +124,7 @@ It worked!
Full docs for the development server are at `django-admin documentation`_.
-.. _django-admin documentation: http://www.djangoproject.com/documentation/django_admin/
+.. _django-admin documentation: ../django-admin/
Database setup
--------------
@@ -117,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
database's connection parameters:
- * ``DATABASE_ENGINE`` -- Either 'postgresql', 'mysql' or 'sqlite3'.
- More coming soon.
+ * ``DATABASE_ENGINE`` -- Either 'postgresql_psycopg2', 'mysql' or 'sqlite3'.
+ Other backends are `also available`_.
* ``DATABASE_NAME`` -- The name of your database, or the full (absolute)
path to the database file if you're using SQLite.
* ``DATABASE_USER`` -- Your database username (not used for SQLite).
@@ -127,6 +143,8 @@ database's connection parameters:
empty string if your database server is on the same physical machine
(not used for SQLite).
+.. _also available: ../settings/
+
.. admonition:: Note
If you're using PostgreSQL or MySQL, make sure you've created a database by
@@ -303,7 +321,8 @@ Now Django knows ``mysite`` includes the ``polls`` app. Let's run another comman
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;
CREATE TABLE "polls_poll" (
@@ -321,6 +340,8 @@ You should see the following (the CREATE TABLE SQL statements for the polls app)
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
(``polls``) and the lowercase name of the model -- ``poll`` and
``choice``. (You can override this behavior.)
@@ -349,8 +370,9 @@ If you're interested, also run the following commands:
* ``python manage.py validate polls`` -- Checks for any errors in the
construction of your models.
- * ``python manage.py sqlinitialdata polls`` -- Outputs any initial data
- required for Django's admin framework and your models.
+ * ``python manage.py sqlcustom polls`` -- Outputs any custom SQL statements
+ (such as table modifications or constraints) that are defined for the
+ application.
* ``python manage.py sqlclear polls`` -- Outputs the necessary ``DROP
TABLE`` statements for this app, according to which tables already exist
@@ -360,7 +382,7 @@ If you're interested, also run the following commands:
statements for this app.
* ``python manage.py sqlall polls`` -- A combination of all the SQL from
- the 'sql', 'sqlinitialdata', and 'sqlindexes' commands.
+ the 'sql', 'sqlcustom', and 'sqlindexes' commands.
Looking at the output of those commands can help you understand what's actually
happening under the hood.
@@ -378,7 +400,7 @@ as you like, and it will only ever create the tables that don't exist.
Read the `django-admin.py documentation`_ for full information on what the
``manage.py`` utility can do.
-.. _django-admin.py documentation: http://www.djangoproject.com/documentation/django_admin/
+.. _django-admin.py documentation: ../django-admin/
Playing with the API
====================
@@ -555,5 +577,5 @@ For full details on the database API, see our `Database API reference`_.
When you're comfortable with the API, read `part 2 of this tutorial`_ to get
Django's automatic admin working.
-.. _Database API reference: http://www.djangoproject.com/documentation/db_api/
-.. _part 2 of this tutorial: http://www.djangoproject.com/documentation/tutorial2/
+.. _Database API reference: ../db-api/
+.. _part 2 of this tutorial: ../tutorial02/