diff options
author | Guilherme Salgado <guilherme.salgado@linaro.org> | 2011-02-28 02:38:29 +0000 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2011-04-14 11:39:03 +0800 |
commit | e84c31852aae3d1c79fe3cbb1aea2ca9646197ef (patch) | |
tree | 347d1ab987f5844758ebc2c18bf01fb275351423 /apps/settings.py | |
parent | ac5cddbc75745bcfddc6e3ed97d75edc49540e27 (diff) | |
download | patchwork-e84c31852aae3d1c79fe3cbb1aea2ca9646197ef.tar patchwork-e84c31852aae3d1c79fe3cbb1aea2ca9646197ef.tar.gz |
settings: Remove hard-coded absolute paths
This is so that you don't have to change a dozen variables when you
deploy an instance somewhere other than on /srv/patchwork.
Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/settings.py')
-rw-r--r-- | apps/settings.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/settings.py b/apps/settings.py index 68837b3..f56da70 100644 --- a/apps/settings.py +++ b/apps/settings.py @@ -1,4 +1,5 @@ # Django settings for patchwork project. +import os DEBUG = True TEMPLATE_DEBUG = DEBUG @@ -34,10 +35,6 @@ SITE_ID = 1 # to load the internationalization machinery. USE_I18N = True -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = '/srv/patchwork/lib/python/django/contrib/admin/media' - # URL that handles the media served from MEDIA_ROOT. # Example: "http://media.lawrence.com" MEDIA_URL = '' @@ -70,12 +67,20 @@ ROOT_URLCONF = 'apps.urls' LOGIN_URL = '/accounts/login' LOGIN_REDIRECT_URL = '/user/' +# If you change the ROOT_DIR setting in your local_settings.py, you'll need to +# re-define the variables that use this (MEDIA_ROOT and TEMPLATE_DIRS) too. +ROOT_DIR = '/srv/patchwork' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. - '/srv/patchwork/templates' + os.path.join(ROOT_DIR, 'templates') ) +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = os.path.join( + ROOT_DIR, 'lib', 'python', 'django', 'contrib', 'admin', 'media') + TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.auth", "django.core.context_processors.debug", |