X-Git-Url: https://git.mdrn.pl/cas.git/blobdiff_plain/2c9debf2812dfbd4ff59348559ae57cd49858e8b..ba4a79354412a4679b7a24358c9a09fc60ea78c2:/src/cas/settings.py diff --git a/src/cas/settings.py b/src/cas/settings.py index 21a4a35..1883595 100644 --- a/src/cas/settings.py +++ b/src/cas/settings.py @@ -4,7 +4,6 @@ from os import path PROJECT_ROOT = path.realpath(path.dirname(__file__)) DEBUG = True -TEMPLATE_DEBUG = DEBUG ADMINS = [ ] @@ -27,7 +26,7 @@ DATABASES = { # although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. -TIME_ZONE = None +TIME_ZONE = 'UTC' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html @@ -41,22 +40,47 @@ USE_I18N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = PROJECT_ROOT + '/media/' +MEDIA_ROOT = path.join(PROJECT_ROOT, '../../media/') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/media/' -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = '/admin-media/' +STATIC_ROOT = path.join(PROJECT_ROOT, '../../static/') +STATIC_URL = '/static/' + +STATICFILES_DIRS = [ + path.join(PROJECT_ROOT, 'static'), +] ROOT_URLCONF = 'cas.urls' -TEMPLATE_DIRS = ( - PROJECT_ROOT + '/templates', +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'APP_DIRS': True, + 'DIRS': [ + PROJECT_ROOT + '/templates', + ], + 'OPTIONS': { + 'context_processors': [ + "django.contrib.auth.context_processors.auth", + "django.template.context_processors.debug", + "django.template.context_processors.i18n", + "django.template.context_processors.media", + "django.template.context_processors.static", + "django.template.context_processors.tz", + "django.contrib.messages.context_processors.messages", + "django.template.context_processors.request", + ], + 'debug': DEBUG, + }, + }, +] + +LOCALE_PATHS = ( + PROJECT_ROOT + '/locale', ) INSTALLED_APPS = ( @@ -66,14 +90,23 @@ INSTALLED_APPS = ( 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', + 'django.contrib.staticfiles', 'cas_provider', - 'gravatar', - 'south', + 'django_gravatar', 'accounts', ) +MIDDLEWARE = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +) + # django-cas-provider settings LOGIN_URL = '/cas/login/' LOGOUT_URL = '/cas/logout/' @@ -82,9 +115,10 @@ CAS_CUSTOM_ATTRIBUTES_CALLBACK = 'cas.utils.custom_attributes_callback' SESSION_COOKIE_NAME = 'fnpcas' GRAVATAR_DEFAULT_IMAGE = 'mm' +GRAVATAR_URL_PREFIX = 'https://www.gravatar.com/' # Import localsettings file, which may override settings defined here try: - from localsettings import * + from .localsettings import * except ImportError: pass