Changes between Version 5 and Version 6 of MagicRemovalCheatSheet


Ignore:
Timestamp:
05/11/06 23:46:47 (9 years ago)
Author:
eugene@…
Comment:

added settings

Legend:

Unmodified
Added
Removed
Modified
  • MagicRemovalCheatSheet

    v5 v6  
    2727   * {{{auth_user_user_permissions}}}
    2828   * {{{django_content_type}}}
    29  * '''After you finished with code changes''', run {{{django-admin.py syncdb}}} or {{{manage.py syncdb}}}. '''Don't do it now!'''
     29 * '''After you finished with code changes''', run {{{manage.py syncdb}}}. '''Don't do it now!'''
    3030
    3131It repopulates the content of said tables properly, but an administrator has to reassign group and user permissions again in Admin. Obviously it can be a problem, if you have hundreds of users with arcane permissions.
     
    5656   * {{{django.core.extensions}}} => {{{django.shortcuts}}}
    5757   * '''renamed:''' {{{django.core.extensions.DjangoContext}}} => {{{django.template.RequestContext}}}
     58   * '''moved:''' {{{django.models.core.Session}}} => {{{django.contrib.sessions.models.Session}}}
    5859 1. A former module {{{settings}}} is an instance now. [wiki:RemovingTheMagic#Movedsettingsintoaninstance Import it] using:
    5960{{{
     
    9192== URLs and settings ==
    9293
     94 1. Update {{{urls.py}}}:
     95   1. Admin URLConf was [wiki:RemovingTheMagic#MovedadminURLconftoshortenitspath relocated:
     96     * {{{django.contrib.admin.urls.admin}}} => {{{django.contrib.admin.urls}}}
     97   1. [wiki:RemovingTheMagic#Changedtheparametersyoupasstogenericviews Change the parameters you pass to generic views]: remove {{{app_label}}} and {{{model_name}}}, add {{{queryset}}}.
     98 1. Update {{{settings.py}}}:
     99   1. Update {{{TEMPLATE_LOADERS}}} to reflect [wiki:RemovingTheMagic#Namespacesimplification Namespace simplification]: remove {{{core}} from their names.
     100   1. Update {{{INSTALLED_APPS}}} to reflect [wiki:RemovingTheMagic#Namespacesimplification Namespace simplification]:
     101     * {{{django.models.auth}}} => {{{django.contrib.auth.models}}}
     102     * {{{django.models.core.sites}}} => {{{django.contrib.sites.models}}}
     103     * {{{django.models.core.contenttypes}}} => {{{django.contrib.contenttypes.models}}}
     104   1. Update {{{INSTALLED_APPS}}} to reflect changes you made in the Models section:
     105     * {{{yourproject.apps.yourapp}}} => {{{yourproject.yourapp}}}
     106   1. Add additional applications to your {{{INSTALLED_APPS}}} to satisfy dependencies:
     107     * Before {{{django.contrib.admin}}} add {{{django.contrib.auth}}} and {{{django.contrib.contenttypes}}}.
     108     * Before {{{django.contrib.flatpages}}} and/or {{{django.contrib.redirects}}} add {{{django.contrib.sites}}}.
     109   1. The {{{packages}}} module [wiki:RemovingTheMagic#Thepackagesmoduleisnomore has been removed].
     110   1. Update {{{MIDDLEWARE_CLASSES}}} to reflect [wiki:RemovingTheMagic#Namespacesimplification Namespace simplification]:
     111     * {{{django.middleware.sessions.SessionMiddleware}}} => {{{django.contrib.sessions.middleware.SessionMiddleware}}}
     112   1. If you rely on {{{request.user}}} [wiki:RemovingTheMagic#request.userisnowsetviamiddleware anywhere in your code], modify {{{MIDDLEWARE_CLASSES}}}:
     113     * Add {{{django.contrib.auth.middleware.AuthenticationMiddleware}}} anywhere after {{{django.contrib.sessions.middleware.SessionMiddleware}}}.
     114
    93115== Post-conversion ==
    94116
    95 If you decided to regenerate permissions, now is the good time to execute {{{django-admin.py syncdb}}} or {{{manage.py syncdb}}}. Remember that an administrator should reassign permissions to all users using Admin.
     117Debug your changes using {{{manage.py validate}}} and {{{manage.py runserver}}}. If there are any problems, please refer to the appropriate section of this document to verify your changes, and consult [wiki:RemovingTheMagic Removing the magic].
     118
     119If you decided to regenerate permissions (see the Pre-conversion section above), now is the good time to execute {{{manage.py syncdb}}}. Remember that an administrator should reassign permissions to all users using Admin.
Back to Top