]> git.ozlabs.org Git - patchwork/commitdiff
Use local settings module
authorJeremy Kerr <jk@ozlabs.org>
Fri, 5 Sep 2008 06:12:21 +0000 (16:12 +1000)
committerJeremy Kerr <jk@ozlabs.org>
Fri, 5 Sep 2008 06:12:21 +0000 (16:12 +1000)
This makes checkouts into a working patchwork site much easier.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/settings.py
docs/INSTALL

index 719b9d174cbfb82a16690cd3515f793a6b0a70d3..d5fd7b1a7509c87a8def367589ba46cd055824d3 100644 (file)
@@ -97,3 +97,13 @@ DEFAULT_PATCHES_PER_PAGE = 100
 DEFAULT_FROM_EMAIL = 'Patchwork <patchwork@patchwork.example.com>'
 
 ACCOUNT_ACTIVATION_DAYS = 7
+
+try:
+    from local_settings import *
+except ImportError, ex:
+    import sys
+    sys.stderr.write(\
+            ("settings.py: error importing local settings file:\n" + \
+            "\t%s\n" + \
+            "Do you have a local_settings.py module?\n") % str(ex))
+    raise
index 0d5cc3e78553510a10658ea1a060e139edb85e5b..1748601954c04cc095318f1cfde346433c94d4b8 100644 (file)
@@ -62,15 +62,17 @@ in brackets):
          cd ../../apps
          ln -s ../lib/packages/django-registration ./registration
 
-       You'll need to customise apps/settings.py to suit your database, and
-       change the SECRET_KEY variable too. While you're there, change the
-       following to suit your installation:
+       The settings.py file contains default settings for patchwork, you'll
+       need to configure settings for your own setup.
 
-          SECRET_KEY
+       Rather than edit settings.py, create a file 'local_settings.py', and
+       override or add settings as necessary. You'll need to define the
+       following:
+
+         SECRET_KEY
          ADMINS
          TIME_ZONE
          LANGUAGE_CODE
-         MEDIA_ROOT
 
         You can generate the SECRET_KEY with the following python code:
 
@@ -78,10 +80,16 @@ in brackets):
           chars = string.letters + string.digits + string.punctuation
           print repr("".join([random.choice(chars) for i in range(0,50)]))
 
+       If you have patchwork installed in somewhere other than /srv/patchwork,
+       you'll also need to define:
+
+         MEDIA_ROOT
+         TEMPLATE_DIRS
+
        Then, get patchwork to create its tables in your configured database:
 
         cd apps/
-        ./manage.py syncdb
+        PYTHONPATH=../lib/python ./manage.py syncdb
 
        And add privileges for your mail and web users: