@@ -15,6 +15,7 @@ in brackets):
15
15
* A database server (postgresql, mysql)
16
16
* relevant python modules for the database server (e.g: python-mysqldb)
17
17
18
+
18
19
1. Database setup
19
20
20
21
At present, I've tested with PostgreSQL and (to a lesser extent) MySQL
@@ -89,69 +90,71 @@ in brackets):
89
90
it, tests checking for the correct handling of non-ASCII characters
90
91
fail.
91
92
93
+
92
94
2. Django setup
93
95
94
- Set up some initial directories in the patchwork base directory:
96
+ Set up some initial directories in the patchwork base directory:
95
97
96
- mkdir -p lib/packages lib/python
98
+ mkdir -p lib/packages lib/python
97
99
98
- lib/packages is for stuff we'll download; lib/python is to add
99
- to our python path. We'll symlink python modules into lib/python.
100
+ lib/packages is for stuff we'll download; lib/python is to add
101
+ to our python path. We'll symlink python modules into lib/python.
100
102
101
- At the time of release, patchwork depends on django version 1.5 or
102
- later. Your distro probably provides this. If not, do a:
103
+ At the time of release, patchwork depends on django version 1.5 or
104
+ later. Your distro probably provides this. If not, do a:
103
105
104
- cd lib/packages
105
- git clone https://github.com/django/django.git -b stable/1.5.x
106
- cd ../python
107
- ln -s ../packages/django/django ./django
106
+ cd lib/packages
107
+ git clone https://github.com/django/django.git -b stable/1.5.x
108
+ cd ../python
109
+ ln -s ../packages/django/django ./django
108
110
109
- The settings.py file contains default settings for patchwork, you'll
110
- need to configure settings for your own setup.
111
+ The settings.py file contains default settings for patchwork, you'll
112
+ need to configure settings for your own setup.
111
113
112
- Rather than edit settings.py, create a file 'local_settings.py', and
113
- override or add settings as necessary. You'll need to define the
114
- following:
114
+ Rather than edit settings.py, create a file 'local_settings.py', and
115
+ override or add settings as necessary. You'll need to define the
116
+ following:
115
117
116
- SECRET_KEY
117
- ADMINS
118
- TIME_ZONE
119
- LANGUAGE_CODE
120
- DEFAULT_FROM_EMAIL
121
- NOTIFICATION_FROM_EMAIL
118
+ SECRET_KEY
119
+ ADMINS
120
+ TIME_ZONE
121
+ LANGUAGE_CODE
122
+ DEFAULT_FROM_EMAIL
123
+ NOTIFICATION_FROM_EMAIL
122
124
123
- You can generate the SECRET_KEY with the following python code:
125
+ You can generate the SECRET_KEY with the following python code:
124
126
125
- import string, random
126
- chars = string.letters + string.digits + string.punctuation
127
- print repr("".join([random.choice(chars) for i in range(0,50)]))
127
+ import string, random
128
+ chars = string.letters + string.digits + string.punctuation
129
+ print repr("".join([random.choice(chars) for i in range(0,50)]))
128
130
129
- If you wish to enable the XML-RPC interface, add the following to
130
- your local_settings.py file:
131
+ If you wish to enable the XML-RPC interface, add the following to
132
+ your local_settings.py file:
131
133
132
- ENABLE_XMLRPC = True
134
+ ENABLE_XMLRPC = True
133
135
134
- Then, get patchwork to create its tables in your configured database:
136
+ Then, get patchwork to create its tables in your configured database:
135
137
136
- cd apps/
137
- PYTHONPATH=../lib/python ./manage.py syncdb
138
+ cd apps/
139
+ PYTHONPATH=../lib/python ./manage.py syncdb
138
140
139
- And add privileges for your mail and web users. This is only needed if
140
- you use the ident-based approach. If you use password-based database
141
- authentication, you can skip this step.
141
+ And add privileges for your mail and web users. This is only needed if
142
+ you use the ident-based approach. If you use password-based database
143
+ authentication, you can skip this step.
142
144
143
- Postgresql:
144
- psql -f lib/sql/grant-all.postgres.sql patchwork
145
+ Postgresql:
146
+ psql -f lib/sql/grant-all.postgres.sql patchwork
145
147
146
- MySQL:
147
- mysql patchwork < lib/sql/grant-all.mysql.sql
148
+ MySQL:
149
+ mysql patchwork < lib/sql/grant-all.mysql.sql
148
150
149
151
150
152
3. Apache setup
151
153
152
- Example apache configuration files are in lib/apache2/.
154
+ Example apache configuration files are in lib/apache2/.
155
+
156
+ wsgi:
153
157
154
- wsgi:
155
158
django has built-in support for WSGI, which supersedes the fastcgi
156
159
handler. It is thus the preferred method to run patchwork.
157
160
@@ -164,7 +167,8 @@ wsgi:
164
167
a2enmod wsgi
165
168
apache2ctl restart
166
169
167
- mod_python:
170
+
171
+ mod_python:
168
172
169
173
An example apache configuration file for mod_python is in:
170
174
@@ -174,7 +178,8 @@ mod_python:
174
178
web server is used for serving php files, the fastcgi method may suit
175
179
instead.
176
180
177
- fastcgi:
181
+
182
+ fastcgi:
178
183
179
184
django has built-in support for fastcgi, which requires the
180
185
'flup' python module. An example configuration is in:
@@ -190,6 +195,7 @@ fastcgi:
190
195
socket=/srv/patchwork/var/fcgi.sock \
191
196
pidfile=/srv/patchwork/var/fcgi.pid
192
197
198
+
193
199
4. Configure patchwork
194
200
Now, you should be able to administer patchwork, by visiting the
195
201
URL:
@@ -201,12 +207,14 @@ fastcgi:
201
207
* Set up your projects
202
208
* Configure your website address (in the Sites) section
203
209
210
+
204
211
5. Subscribe a local address to the mailing list
205
212
206
- You will need an email address for patchwork to receive email on - for
207
- example - patchwork@, and this address will need to be subscribed to the
208
- list. Depending on the mailing list, you will probably need to confirm the
209
- subscription - temporarily direct the alias to yourself to do this.
213
+ You will need an email address for patchwork to receive email on - for
214
+ example - patchwork@, and this address will need to be subscribed to the
215
+ list. Depending on the mailing list, you will probably need to confirm the
216
+ subscription - temporarily direct the alias to yourself to do this.
217
+
210
218
211
219
6. Setup your MTA to deliver mail to the parsemail script
212
220
@@ -223,6 +231,7 @@ fastcgi:
223
231
224
232
sudo -u nobody /srv/patchwork/apps/patchwork/bin/parsemail.sh < mail
225
233
234
+
226
235
7. Set up the patchwork cron script
227
236
228
237
Patchwork uses a cron script to clean up expired registrations, and
@@ -239,6 +248,7 @@ fastcgi:
239
248
- the frequency should be the same as the NOTIFICATION_DELAY_MINUTES
240
249
setting, which defaults to 10 minutes.
241
250
251
+
242
252
8. Optional: Configure your VCS to automatically update patches
243
253
244
254
The tools directory of the patchwork distribution contains a file
@@ -257,6 +267,7 @@ fastcgi:
257
267
similar hook using pwclient to update patch state. If you do write
258
268
one, please contribute it.
259
269
270
+
260
271
Some errors:
261
272
262
273
* __init__() got an unexpected keyword argument 'max_length'
0 commit comments