Changeset 2781
- Timestamp:
- 04/28/06 20:50:35 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/docs/legacy_databases.txt
r2711 r2781 46 46 Save this as a file by using standard Unix output redirection:: 47 47 48 django-admin.py inspectdb --settings=path.to.settings > appname.py48 django-admin.py inspectdb --settings=path.to.settings > models.py 49 49 50 50 This feature is meant as a shortcut, not as definitive model generation. See 51 51 the `django-admin.py documentation`_ for more information. 52 52 53 Once you've cleaned up the model, put the module in the ``models`` directory of 54 your app, and add it to your ``INSTALLED_APPS`` setting. 53 Once you've cleaned up your models, name the file ``models.py`` and put it in 54 the Python package that holds your app. Then add the app to your 55 ``INSTALLED_APPS`` setting. 55 56 56 57 .. _django-admin.py documentation: http://www.djangoproject.com/documentation/django_admin/ … … 59 60 ============================== 60 61 61 Next, run the `` django-admin.py init`` command to install Django's core tables62 in your database::62 Next, run the ``manage.py syncdb`` command to install any extra needed database 63 records such as admin permissions and content types:: 63 64 64 65 django-admin.py init --settings=path.to.settings 65 66 This won't work if your database already contains tables that have any of the67 following names:68 69 * ``django_site``70 * ``django_content_type``71 * ``django_sessions``72 * ``auth_permission``73 * ``auth_group``74 * ``auth_user``75 * ``auth_message``76 * ``auth_group_permissions``77 * ``auth_user_groups``78 * ``auth_user_user_permission``79 80 If that's the case, try renaming one of your tables to resolve naming81 conflicts. Currently, there's no way of customizing the names of Django's82 database tables without editing Django's source code itself.83 84 Install metadata about your app85 ===============================86 87 Django has a couple of database tables that contain metadata about your apps.88 You'll need to execute the SQL output by this command::89 90 django-admin.py sqlinitialdata [appname] --settings=path.to.settings91 66 92 67 See whether it worked
