blob: 7c6eed7dc034b507fb6e39af33080b40257a8143 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
.. -*- coding: utf-8 -*-
===============
Chimère upgrade
===============
:Author: Étienne Loks
:date: 2012-02-15
:Copyright: CC-BY 3.0
Get new version of dependencies
-------------------------------
From version 1.2 to 2.x
***********************
Install `Django South <http://south.aeracode.org/>`_.
From version prior to 1.1 to 1.1
********************************
Upgrade Django to the 1.2 version.
Install the `Beautiful Soup <http://www.crummy.com/software/BeautifulSoup/>`_ library.
Get the new version
-------------------
First of all get the new version of the code source. You have two choices from
the archive or from the Git repository.
Download archive from the download site
***************************************
Versions are available at this `address <http://www.peacefrogs.net/download/chimere/>`_.
Take care of getting the last version in the desired X.Y branch (for instance
the last version for the 1.0 branch is version 1.0.2 as the time of writing of
this document).
Extract it to the desired destination path::
wget http://www.peacefrogs.net/download/chimere -q -O -| html2text
(...)
[[ ]] chimere-1.0.0.tar.bz2 17-Nov-2010 16:51 53K
[[ ]] chimere-1.0.1.tar.bz2 17-Nov-2010 16:51 53K
[[ ]] chimere-1.0.2.tar.bz2 17-Nov-2010 16:51 53K
(...)
wget http://www.peacefrogs.net/download/chimere/chimere-1.0.2.tar.bz2
mv chimere-1.0.2.tar.bz2 /var/local/django
cd /var/local/django
tar xvjf chimere-1.0.2.tar.bz2
cd chimere-1.0.2
Get from the Git repository
***************************
Clone the Git repository, checkout the desired version and copy it to the
desired destination path::
git clone git://www.peacefrogs.net/git/chimere
cd chimere
git tag -l
(...)
v1.0.0
v1.0.1
v1.0.2
git checkout v1.0.2
cd ..
mv chimere /var/local/dgango/chimere-1.0
cd /var/local/dgango/chimere-1.0
Copy files from your old installation
-------------------------------------
From your old installation at least copy "settings.py" and the content of
"static/icons/" and "static/upload/" to the new installation.
You have probably customised some styles and templates (for instance
"styles.css", "welcome.html" and "base_user.html") don't forget to copy them and
eventualy adapt them (if you have old vanilla version of this file comparing
with the new one provided is easier).
Adapt settings.py
-----------------
The format of settings.py could have evolved, the easiest way to complete your
settings.py is to compare your old settings.py.example and the new one provided.
Upgrade to version 2.0
**********************
- Add to the settings.py a STATIC_URL variable by default set to '/static/' (be
careful to change MEDIA_URL if it is already set to '/static/').
- Add the detail of TEMPLATE_CONTEXT_PROCESSORS (see settings.py.example)
Specific upgrade from version 1.0 to version 1.1
************************************************
Version 1.1 of Chimère uses Django 1.2 and with it the way to define database
has changed.
Old way to define your database is::
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'chimere'
DATABASE_USER = 'chimere-user'
DATABASE_PASSWORD = 'password'
DATABASE_HOST = 'localhost'
DATABASE_PORT = ''
The new one looks like::
DATABASES = {
'default': {
'NAME': 'ratatouille',
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'HOST': 'localhost',
'PORT': '5432',
'USER': 'chimere-user',
'PASSWORD': 'password',
},
}
Be careful to adapt properly your settings.py
Migrate database
----------------
From 1.2 to 2.x
***************
Django South is now used to manage database migrations. Add 'south' to your
INSTALLED_APPS list in settings.py and run::
./manage.py syncdb
./manage.py migrate chimere 0001 --fake
./manage.py migrate chimere
From version prior to 1.2 to 1.2
********************************
Migration scripts test your installation before making changes so you probably
won't have any lost but by precaution before running theses scripts don't forget
to backup your database.
You can also make a copy of your current database into a new database and make
the new installation to this new database.
The gdal binding for python is necessary to run the upgrade scripts (available
in the python-gdal package in Debian).
If you run the migration scripts in a production environnement stop the old
instance of Chimère before executing the migration script. Perhaps prepare the
web server to point to the new installation before doing the database upgrade
(cf. next paragraph).
In "settings.py" verify that "chimere.scripts" is in the INSTALLED_APPS.
After that in the chimere directory just execute the script::
python ./scripts/upgrade
Point to the new installation
-----------------------------
Most of the job is done. You'll just have to configure your web server to serve
the new version.
For instance for Apache the directive is changed from::
PythonPath "['/var/local/django/chimere/'] + sys.path"
To::
PythonPath "['/var/local/django/chimere-1.0.2/'] + sys.path"
Restart your web server and apart from web browser cache issues this should work.
Force the upgrade of visitor's web browser cache
------------------------------------------------
If major changes in the javascript has be done between version, many of your
users could experience problems. There are many tricks to force the refresh
of their cache. One of them is to change the location of statics files. To do
that edit your settings.py and change::
MEDIA_ROOT = ROOT_PATH + 'static/'
MEDIA_URL = '/' + EXTRA_URL + 'static/'
To::
MEDIA_ROOT = ROOT_PATH + 'static/v1.0.2/'
MEDIA_URL = '/' + EXTRA_URL + 'static/v1.0.2/'
Then in the static directory::
ln -s `pwd` v1.0.2
Restart the web server to apply changes.
|