Skip to content

Commit ad2762c

Browse files
committed
Move to a more recent django project structure
This change updates patchwor to the newer project struture: we've moved the actual application out of the apps/ directory, and the patchwork-specific templates to under the patchwork application. This gives us the manage.py script in the top-level now. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
1 parent f09e982 commit ad2762c

120 files changed

Lines changed: 23 additions & 25 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/patchwork/templatetags/__init__.py

Whitespace-only changes.

docs/HACKING

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ It's always a good idea to use virtualenv to develop python software.
4343

4444
5. Now one can run patchwork within that environment
4545

46-
(django-1.7)$ ./apps/manage.py --version
46+
(django-1.7)$ ./manage.py --version
4747
1.7
48-
(django-1.7)$ ./apps/manage.py runserver
48+
(django-1.7)$ ./manage.py runserver
4949

5050
6. To exit the virtual environment
5151

docs/INSTALL

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ in brackets):
135135

136136
Then, get patchwork to create its tables in your configured database:
137137

138-
cd apps/
139-
PYTHONPATH=../lib/python ./manage.py syncdb
138+
PYTHONPATH=lib/python ./manage.py syncdb
140139

141140
And add privileges for your mail and web users. This is only needed if
142141
you use the ident-based approach. If you use password-based database
@@ -190,7 +189,7 @@ in brackets):
190189

191190
Once you have apache set up, you can start the fastcgi server with:
192191

193-
cd /srv/patchwork/apps
192+
cd /srv/patchwork/
194193
./manage.py runfcgi method=prefork \
195194
socket=/srv/patchwork/var/fcgi.sock \
196195
pidfile=/srv/patchwork/var/fcgi.pid
@@ -222,14 +221,14 @@ in brackets):
222221
directory. (Note, do not use the parsemail.py script directly). Something
223222
like this in /etc/aliases is suitable for postfix:
224223

225-
patchwork: "|/srv/patchwork/apps/patchwork/bin/parsemail.sh"
224+
patchwork: "|/srv/patchwork/patchwork/bin/parsemail.sh"
226225

227226
You may need to customise the parsemail.sh script if you haven't installed
228227
patchwork in /srv/patchwork.
229228

230229
Test that you can deliver a patch to this script:
231230

232-
sudo -u nobody /srv/patchwork/apps/patchwork/bin/parsemail.sh < mail
231+
sudo -u nobody /srv/patchwork/patchwork/bin/parsemail.sh < mail
233232

234233

235234
7. Set up the patchwork cron script
@@ -240,9 +239,9 @@ in brackets):
240239
Something like this in your crontab should work:
241240

242241
# m h dom mon dow command
243-
PYTHONPATH=apps:.
242+
PYTHONPATH=.
244243
DJANGO_SETTINGS_MODULE=settings
245-
*/10 * * * * cd patchwork; python apps/patchwork/bin/patchwork-cron.py
244+
*/10 * * * * cd patchwork; python patchwork/bin/patchwork-cron.py
246245

247246

248247
- the frequency should be the same as the NOTIFICATION_DELAY_MINUTES

lib/apache2/patchwork.mod_python.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ NameVirtualHost patchwork.example.com:80
77
<Location "/">
88
SetHandler python-program
99
PythonHandler django.core.handlers.modpython
10-
PythonPath "['/srv/patchwork/apps', '/srv/patchwork/lib/python'] + sys.path"
10+
PythonPath "['/srv/patchwork', '/srv/patchwork/lib/python'] + sys.path"
1111
SetEnv DJANGO_SETTINGS_MODULE settings
1212
</Location>
1313

lib/apache2/patchwork.wsgi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import sys
1212
basedir = os.path.join(
1313
os.path.dirname(__file__), os.path.pardir, os.path.pardir)
1414
sys.path.append(basedir)
15-
sys.path.append(os.path.join(basedir, 'apps'))
1615

17-
os.environ['DJANGO_SETTINGS_MODULE'] = 'apps.settings'
16+
os.environ['DJANGO_SETTINGS_MODULE'] = 'patchwork.settings.prod'
1817
import django.core.handlers.wsgi
1918
application = django.core.handlers.wsgi.WSGIHandler()
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)