Commit ad2762cf authored by Jeremy Kerr's avatar Jeremy Kerr
Browse files

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 script in the top-level now.
Signed-off-by: default avatarJeremy Kerr <>
parent f09e982f
......@@ -43,9 +43,9 @@ It's always a good idea to use virtualenv to develop python software.
5. Now one can run patchwork within that environment
(django-1.7)$ ./apps/ --version
(django-1.7)$ ./ --version
(django-1.7)$ ./apps/ runserver
(django-1.7)$ ./ runserver
6. To exit the virtual environment
......@@ -135,8 +135,7 @@ in brackets):
Then, get patchwork to create its tables in your configured database:
cd apps/
PYTHONPATH=../lib/python ./ syncdb
PYTHONPATH=lib/python ./ syncdb
And add privileges for your mail and web users. This is only needed if
you use the ident-based approach. If you use password-based database
......@@ -190,7 +189,7 @@ in brackets):
Once you have apache set up, you can start the fastcgi server with:
cd /srv/patchwork/apps
cd /srv/patchwork/
./ runfcgi method=prefork \
socket=/srv/patchwork/var/fcgi.sock \
......@@ -222,14 +221,14 @@ in brackets):
directory. (Note, do not use the script directly). Something
like this in /etc/aliases is suitable for postfix:
patchwork: "|/srv/patchwork/apps/patchwork/bin/"
patchwork: "|/srv/patchwork/patchwork/bin/"
You may need to customise the script if you haven't installed
patchwork in /srv/patchwork.
Test that you can deliver a patch to this script:
sudo -u nobody /srv/patchwork/apps/patchwork/bin/ < mail
sudo -u nobody /srv/patchwork/patchwork/bin/ < mail
7. Set up the patchwork cron script
......@@ -240,9 +239,9 @@ in brackets):
Something like this in your crontab should work:
# m h dom mon dow command
*/10 * * * * cd patchwork; python apps/patchwork/bin/
*/10 * * * * cd patchwork; python patchwork/bin/
- the frequency should be the same as the NOTIFICATION_DELAY_MINUTES
......@@ -7,7 +7,7 @@ NameVirtualHost
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "['/srv/patchwork/apps', '/srv/patchwork/lib/python'] + sys.path"
PythonPath "['/srv/patchwork', '/srv/patchwork/lib/python'] + sys.path"
......@@ -12,8 +12,7 @@ import sys
basedir = os.path.join(
os.path.dirname(__file__), os.path.pardir, os.path.pardir)
sys.path.append(os.path.join(basedir, 'apps'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'apps.settings'
os.environ['DJANGO_SETTINGS_MODULE'] = ''
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
......@@ -20,10 +20,10 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
BIN_DIR=`dirname $0`
PATCHWORK_BASE=`readlink -e $BIN_DIR/../../..`
PATCHWORK_BASE=`readlink -e $BIN_DIR/../..`
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment