summaryrefslogtreecommitdiff
path: root/docs/legacy_databases.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-05-02 01:31:56 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-05-02 01:31:56 +0000
commitf69cf70ed813a8cd7e1f963a14ae39103e8d5265 (patch)
treed3b32e84cd66573b3833ddf662af020f8ef2f7a8 /docs/legacy_databases.txt
parentd5dbeaa9be359a4c794885c2e9f1b5a7e5e51fb8 (diff)
MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/legacy_databases.txt')
-rw-r--r--docs/legacy_databases.txt44
1 files changed, 9 insertions, 35 deletions
diff --git a/docs/legacy_databases.txt b/docs/legacy_databases.txt
index f1b8f85970..66cb1a2ef4 100644
--- a/docs/legacy_databases.txt
+++ b/docs/legacy_databases.txt
@@ -18,6 +18,7 @@ You'll need to tell Django what your database connection parameters are, and
what the name of the database is. Do that by editing these settings in your
`settings file`_:
+ * `DATABASE_NAME`
* `DATABASE_ENGINE`_
* `DATABASE_USER`_
* `DATABASE_PASSWORD`_
@@ -26,6 +27,7 @@ what the name of the database is. Do that by editing these settings in your
* `DATABASE_PORT`_
.. _settings file: http://www.djangoproject.com/documentation/settings/
+.. _DATABASE_NAME: http://www.djangoproject.com/documentation/settings/#database-name
.. _DATABASE_ENGINE: http://www.djangoproject.com/documentation/settings/#database-engine
.. _DATABASE_USER: http://www.djangoproject.com/documentation/settings/#database-user
.. _DATABASE_PASSWORD: http://www.djangoproject.com/documentation/settings/#database-password
@@ -39,57 +41,29 @@ Auto-generate the models
Django comes with a utility that can create models by introspecting an existing
database. You can view the output by running this command::
- django-admin.py inspectdb [databasename] --settings=path.to.settings
-
-...where "[databasename]" is the name of your database.
+ django-admin.py inspectdb --settings=path.to.settings
Save this as a file by using standard Unix output redirection::
- django-admin.py inspectdb [databasename] --settings=path.to.settings > appname.py
+ django-admin.py inspectdb --settings=path.to.settings > models.py
This feature is meant as a shortcut, not as definitive model generation. See
the `django-admin.py documentation`_ for more information.
-Once you've cleaned up the model, put the module in the ``models`` directory of
-your app, and add it to your ``INSTALLED_APPS`` setting.
+Once you've cleaned up your models, name the file ``models.py`` and put it in
+the Python package that holds your app. Then add the app to your
+``INSTALLED_APPS`` setting.
.. _django-admin.py documentation: http://www.djangoproject.com/documentation/django_admin/
Install the core Django tables
==============================
-Next, run the ``django-admin.py init`` command to install Django's core tables
-in your database::
+Next, run the ``manage.py syncdb`` command to install any extra needed database
+records such as admin permissions and content types::
django-admin.py init --settings=path.to.settings
-This won't work if your database already contains tables that have any of the
-following names:
-
- * ``sites``
- * ``packages``
- * ``content_types``
- * ``core_sessions``
- * ``auth_permissions``
- * ``auth_groups``
- * ``auth_users``
- * ``auth_messages``
- * ``auth_groups_permissions``
- * ``auth_users_groups``
- * ``auth_users_user_permissions``
-
-If that's the case, try renaming one of your tables to resolve naming
-conflicts. Currently, there's no way of customizing the names of Django's
-database tables without editing Django's source code itself.
-
-Install metadata about your app
-===============================
-
-Django has a couple of database tables that contain metadata about your apps.
-You'll need to execute the SQL output by this command::
-
- django-admin.py sqlinitialdata [appname] --settings=path.to.settings
-
See whether it worked
=====================