X-Git-Url: https://git.ozlabs.org/?p=patchwork;a=blobdiff_plain;f=apps%2Fsettings.py;h=9dbac19d6d686cdbdc34f8297526569c69a2ce75;hp=43a37d8fe539e3da9c6c6a82bdacb99de95536d4;hb=2c57a30465d96e6434f8715d650824c8ed8cfd5a;hpb=0f62b0c1d9e35319c2f0386ac9ba1371e15dc9ec diff --git a/apps/settings.py b/apps/settings.py index 43a37d8..9dbac19 100644 --- a/apps/settings.py +++ b/apps/settings.py @@ -1,5 +1,6 @@ # Django settings for patchwork project. import os +import django DEBUG = True TEMPLATE_DEBUG = DEBUG @@ -51,31 +52,35 @@ SECRET_KEY = '00000000000000000000000000000000000000000000000000' TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.load_template_source', ) -MIDDLEWARE_CLASSES = ( +MIDDLEWARE_CLASSES = [ 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.doc.XViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', -) +] + +if django.VERSION < (1, 7): + MIDDLEWARE_CLASSES.append('django.middleware.doc.XViewMiddleware') +else: + MIDDLEWARE_CLASSES.append( + 'django.contrib.admindocs.middleware.XViewMiddleware') + TEST_RUNNER = 'django.test.runner.DiscoverRunner' -ROOT_URLCONF = 'apps.urls' +ROOT_URLCONF = 'urls' LOGIN_URL = '/user/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' +ROOT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir) 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. - os.path.join(ROOT_DIR, 'templates') + os.path.join(ROOT_DIR, 'templates'), ) # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" @@ -88,8 +93,6 @@ TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.i18n", "django.core.context_processors.media") -AUTH_PROFILE_MODULE = "patchwork.userprofile" - INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes',