Changes between Version 11 and Version 12 of BackwardsIncompatibleChanges

10/18/2005 07:44:50 PM (10 years ago)

Added preliminary "Refactored the admin app" section (Refs #627)


  • BackwardsIncompatibleChanges

    v11 v12  
    115115As of [867], {{{django.core.template_loader}}} is deprecated. Use {{{django.core.template.loader}}} instead.
     117== Refactored the admin app not to require its own settings file ==
     119As of an upcoming changeset, the admin will have been refactored.
     121=== What changed ===
     123 * The admin no longer requires its own settings file. The "main" site and admin site can run on the same Django installation.
     124 * All the admin code moved to {{{django/contrib/admin}}}.
     125 * If you're using the admin, you need to add {{{"django.contrib.admin"}}} to your {{{INSTALLED_APPS}}}.
     126 * The admin database table isn't installed unless you explicitly have the admin installed ({{{ install admin}}}).
     127 * Renamed the admin log database table to give it a {{{"django"}}} prefix.
     129=== How to update your code ===
     131If you're using a Django installation from before this changeset, do the following to restore your admin site:
     133 * Execute this SQL command: {{{ALTER TABLE auth_admin_log RENAME TO django_admin_log;}}}
     134 * Edit your Django settings file (probably called {{{settings/}}}) to make the following changes:
     135   * Add {{{"django.contrib.admin"}}} to {{{INSTALLED_APPS}}}. Order doesn't matter; it can be the first, last, whatever.
     136   * Remove {{{"django.middleware.admin.AdminUserRequired"}}} from {{{MIDDLEWARE_CLASSES}}}, if it's in there.
     137   * Add {{{"django.middleware.sessions.SessionMiddleware"}}} to {{{MIDDLEWARE_CLASSES}}}, if it's not already in there.
     138   * Add {{{"django.core.template.loaders.app_directories.load_template_source"}}} to {{{TEMPLATE_LOADERS}}}, after {{{"django.core.template.loaders.filesystem.load_template_source"}}}. If you don't have the {{{TEMPLATE_LOADERS}}} setting, set it to this:
     139     {{{
     140     TEMPLATE_LOADERS = (
     141         'django.core.template.loaders.filesystem.load_template_source',
     142         'django.core.template.loaders.app_directories.load_template_source',
     143     )
     144     }}}
     146 * Remove your admin settings file (probably called {{{settings/}}}) and admin URLconf (probably called {{{settings/urls/}}}).
     147 * Edit your main URLconf (probably called {{{settings/urls/}}}) and add this line:
     149     {{{
     150     (r'^admin/', include('django.contrib.admin.urls.admin')),
     151     }}}
     153   Change that {{{"admin"}}} to whatever URL you were using for the admin site.
     155The following steps are optional but will tighten your code up. All assume your project is called {{{myproject}}}.
     157 * Move {{{myproject/settings/urls/}}} to {{{myproject/}}}.
     158 * Delete {{{myproject/settings/urls/}}} (unless you had custom things in it, of course).
     159 * Move {{{myproject/settings/}}} to {{{myproject/}}}.
     160 * Edit {{{myproject/}}} to change {{{ROOT_URLCONF}} from {{{"myproject.settings.urls.main"}}} to {{{"myproject.urls"}}}.
Back to Top