Skip to content
Newer
Older
100644 131 lines (80 sloc) 3.23 KB
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
1 *************************************
6d376e7 @andrewschoen fixed typos and added links to other sections and django docs
andrewschoen authored
2 Upgrading from 2.1.x and Django 1.2.x
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
3 *************************************
4
6d376e7 @andrewschoen fixed typos and added links to other sections and django docs
andrewschoen authored
5 Upgrading dependencies
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
6 ======================
7
6d376e7 @andrewschoen fixed typos and added links to other sections and django docs
andrewschoen authored
8 Upgrade both your version of django CMS and Django by running
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
9 the following commands.
10
11 .. code-block:: bash
12
13 pip install --upgrade django-cms==2.2 django==1.3.1
14
b17d235 @stephenmuss Documentation cleanup: fixed typos, grammar, etc.
stephenmuss authored
15 If you are using django-reversion make sure to have at least
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
16 version 1.4 installed
17
18 .. code-block:: bash
19
20 pip install --upgrade django-reversion==1.4
21
22 Also, make sure that django-mptt stays at a version compatible
23 with django CMS
24
25 .. code-block:: bash
26
67ac94f @yakky version fixes in docs
yakky authored
27 pip install --upgrade django-mptt==0.5.1
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
28
29 Updates to ``settings.py``
30 ==========================
31
32 The following changes will need to be made in your settings.py file::
33
34 ADMIN_MEDIA_PREFIX = '/static/admin'
35 STATIC_ROOT = os.path.join(PROJECT_PATH, 'static')
36 STATIC_URL = "/static/"
6d376e7 @andrewschoen fixed typos and added links to other sections and django docs
andrewschoen authored
37
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
38 .. note::
39
6d376e7 @andrewschoen fixed typos and added links to other sections and django docs
andrewschoen authored
40 These are not django CMS settings. Refer to the Django documentation on `staticfiles`_ for more information.
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
41
6d376e7 @andrewschoen fixed typos and added links to other sections and django docs
andrewschoen authored
42 .. _staticfiles: http://readthedocs.org/docs/django/en/latest/ref/contrib/staticfiles.html
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
43
6d376e7 @andrewschoen fixed typos and added links to other sections and django docs
andrewschoen authored
44 .. note::
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
45
6d376e7 @andrewschoen fixed typos and added links to other sections and django docs
andrewschoen authored
46 Please make sure the ``static`` subfolder exists in your
47 project and is writable.
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
48
6d376e7 @andrewschoen fixed typos and added links to other sections and django docs
andrewschoen authored
49 .. note::
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
50
6d376e7 @andrewschoen fixed typos and added links to other sections and django docs
andrewschoen authored
51 PROJECT_PATH is the absolute path to your project. See :ref:`configure-django-cms` for instructions on how to set PROJECT_PATH.
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
52
53 **Remove** the following from :setting:`django:TEMPLATE_CONTEXT_PROCESSORS`::
54
55 django.core.context_processors.auth
56
57 **Add** the following to :setting:`django:TEMPLATE_CONTEXT_PROCESSORS`::
58
59 django.contrib.auth.context_processors.auth
60 django.core.context_processors.static
61 sekizai.context_processors.sekizai
62
63 **Remove** the following from :setting:`django:MIDDLEWARE_CLASSES`::
64
65 cms.middleware.media.PlaceholderMediaMiddleware
66
67 **Remove** the following from :setting:`django:INSTALLED_APPS`::
68
69 publisher
70
71 **Add** the following to :setting:`django:INSTALLED_APPS`::
72
73 sekizai
74 django.contrib.staticfiles
75
76 Template Updates
77 ================
78
79 Make sure to add sekizai tags and ``cms_toolbar`` to your CMS templates.
80
6d376e7 @andrewschoen fixed typos and added links to other sections and django docs
andrewschoen authored
81 .. note::
82
83 ``cms_toolbar`` is only needed if you wish to use the front-end editing. See :ref:`backwards-incompatible-changes` for more information
84
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
85 Here is a simple example for a base template called ``base.html``:
86
87 .. code-block:: html+django
88
89 {% load cms_tags sekizai_tags %}
90 <html>
91 <head>
92 {% render_block "css" %}
93 </head>
94 <body>
95 {% cms_toolbar %}
96 {% placeholder base_content %}
97 {% block base_content%}{% endblock %}
98 {% render_block "js" %}
99 </body>
100 </html>
101
102 Database Updates
103 ================
104
105 Run the following commands to upgrade your database
106
107 .. code-block:: bash
108
109 python manage.py syncdb
110 python manage.py migrate
111
112 Static Media
113 ============
114
6d376e7 @andrewschoen fixed typos and added links to other sections and django docs
andrewschoen authored
115 Add the following to ``urls.py`` to serve static media when developing::
d8b95fc @andrewschoen added documention for upgrading from 2.1.3 to 2.2 and from django 1.2…
andrewschoen authored
116
117 if settings.DEBUG:
118 urlpatterns = patterns('',
119 url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
120 {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
121 url(r'', include('django.contrib.staticfiles.urls')),
122 ) + urlpatterns
123
124 Also run this command to collect static files into your :setting:`django:STATIC_ROOT`::
125
126 python manage.py collectstatic
127
128
129
130
Something went wrong with that request. Please try again.