X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=apps%2Fsettings.py;h=f56da70ea02b871ce84dc816283c430cbf3a3328;hb=8d22361203333811fb75c03442ea65bff7531891;hp=20c8db3f4ed0d13d203da6d75acae20c640c7f2d;hpb=9b312e325e4fba329b062efe1013d67e83815785;p=patchwork diff --git a/apps/settings.py b/apps/settings.py index 20c8db3..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 = '' @@ -62,6 +59,7 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.doc.XViewMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', ) ROOT_URLCONF = 'apps.urls' @@ -69,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",