add templates settings
[xnet] / xnet / settings.py
CommitLineData
33234b2f
RB
1# Django settings for xnet project.
2
3DEBUG = True
4TEMPLATE_DEBUG = DEBUG
5
6import os.path
7ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
8
9def read_pass(name):
10 fname = os.path.join(ROOT_DIR, 'private', name)
11 with open(fname, 'r') as f:
12 return f.readline().strip()
13
14ADMINS = (
15 # ('Your Name', 'your_email@example.com'),
16)
17
18MANAGERS = ADMINS
19
20DATABASES = {
21 'default': {
22 'ENGINE': 'django.db.backends.sqlite3',
23 'NAME': os.path.join(ROOT_DIR, 'db.sqlite'),
24 }
25}
26
27AUTHENTICATION_BACKENDS = (
28 'django_authgroupex.auth.AuthGroupeXBackend',
29)
30AUTHGROUPEX_KEY = read_pass('authgroupex.key')
31AUTHGROUPEX_FIELDS = ('username', 'firstname', 'lastname', 'perms')
32AUTHGROUPEX_SUPERADMIN_PERMS = ('admin',)
33LOGIN_URL = '/xorgauth/'
34LOGIN_REDIRECT_URL = '/'
35
36# Local time zone for this installation. Choices can be found here:
37# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
38# although not all choices may be available on all operating systems.
39# In a Windows environment this must be set to your system time zone.
40TIME_ZONE = 'Europe/Paris'
41
42# Language code for this installation. All choices can be found here:
43# http://www.i18nguy.com/unicode/language-identifiers.html
44LANGUAGE_CODE = 'en-us'
45
46SITE_ID = 1
47
48# If you set this to False, Django will make some optimizations so as not
49# to load the internationalization machinery.
50USE_I18N = True
51
52# If you set this to False, Django will not format dates, numbers and
53# calendars according to the current locale.
54USE_L10N = True
55
56# If you set this to False, Django will not use timezone-aware datetimes.
57USE_TZ = True
58
59# Absolute filesystem path to the directory that will hold user-uploaded files.
60# Example: "/home/media/media.lawrence.com/media/"
61MEDIA_ROOT = ''
62
63# URL that handles the media served from MEDIA_ROOT. Make sure to use a
64# trailing slash.
65# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
66MEDIA_URL = ''
67
68# Absolute path to the directory static files should be collected to.
69# Don't put anything in this directory yourself; store your static files
70# in apps' "static/" subdirectories and in STATICFILES_DIRS.
71# Example: "/home/media/media.lawrence.com/static/"
72STATIC_ROOT = ''
73
74# URL prefix for static files.
75# Example: "http://media.lawrence.com/static/"
76STATIC_URL = '/static/'
77
78# Additional locations of static files
79STATICFILES_DIRS = (
80 # Put strings here, like "/home/html/static" or "C:/www/django/static".
81 # Always use forward slashes, even on Windows.
82 # Don't forget to use absolute paths, not relative paths.
83)
84
85# List of finder classes that know how to find static files in
86# various locations.
87STATICFILES_FINDERS = (
88 'django.contrib.staticfiles.finders.FileSystemFinder',
89 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
90# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
91)
92
93# Make this unique, and don't share it with anybody.
94SECRET_KEY = 'iq9w_94mr$p$a3sr%*cnvt8z($-)zjk1o8wx45dw(6z3%(mwzo'
95
96# List of callables that know how to import templates from various sources.
97TEMPLATE_LOADERS = (
98 'django.template.loaders.filesystem.Loader',
99 'django.template.loaders.app_directories.Loader',
100# 'django.template.loaders.eggs.Loader',
101)
102
103MIDDLEWARE_CLASSES = (
104 'django.middleware.common.CommonMiddleware',
105 'django.contrib.sessions.middleware.SessionMiddleware',
106 'django.middleware.csrf.CsrfViewMiddleware',
107 'django.contrib.auth.middleware.AuthenticationMiddleware',
108 'django.contrib.messages.middleware.MessageMiddleware',
109 # Uncomment the next line for simple clickjacking protection:
110 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
111)
112
113ROOT_URLCONF = 'xnet.urls'
114
115# Python dotted path to the WSGI application used by Django's runserver.
116WSGI_APPLICATION = 'xnet.wsgi.application'
117
118TEMPLATE_DIRS = (
ccb456d7 119 os.path.join(ROOT_DIR, 'templates'),
33234b2f
RB
120 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
121 # Always use forward slashes, even on Windows.
122 # Don't forget to use absolute paths, not relative paths.
123)
124
125INSTALLED_APPS = (
126 'django.contrib.auth',
127 'django.contrib.contenttypes',
128 'django.contrib.sessions',
129 'django.contrib.sites',
130 'django.contrib.messages',
131 'django.contrib.staticfiles',
132 'django.contrib.admin',
133
134 'django_authgroupex',
135 'xnet.site',
136 'xnet.example',
137)
138
139# A sample logging configuration. The only tangible logging
140# performed by this configuration is to send an email to
141# the site admins on every HTTP 500 error when DEBUG=False.
142# See http://docs.djangoproject.com/en/dev/topics/logging for
143# more details on how to customize your logging configuration.
144LOGGING = {
145 'version': 1,
146 'disable_existing_loggers': False,
147 'filters': {
148 'require_debug_false': {
149 '()': 'django.utils.log.RequireDebugFalse'
150 }
151 },
152 'handlers': {
153 'mail_admins': {
154 'level': 'ERROR',
155 'filters': ['require_debug_false'],
156 'class': 'django.utils.log.AdminEmailHandler'
157 }
158 },
159 'loggers': {
160 'django.request': {
161 'handlers': ['mail_admins'],
162 'level': 'ERROR',
163 'propagate': True,
164 },
165 }
166}