1 # Django settings for xnet project.
7 ROOT_DIR
= os
.path
.abspath(os
.path
.dirname(os
.path
.dirname(__file__
)))
10 fname
= os
.path
.join(ROOT_DIR
, 'private', name
)
11 with
open(fname
, 'r') as f
:
12 return f
.readline().strip()
15 # ('Your Name', 'your_email@example.com'),
20 AUTHENTICATION_BACKENDS
= (
21 'django_authgroupex.auth.AuthGroupeXBackend',
23 AUTHGROUPEX_KEY
= read_pass('authgroupex.key')
24 AUTHGROUPEX_FIELDS
= ('username', 'firstname', 'lastname', 'perms')
25 AUTHGROUPEX_SUPERADMIN_PERMS
= ('admin',)
26 AUTHGROUPEX_USER_MODEL
= 'accounts.Account'
27 LOGIN_URL
= '/xorgauth/'
28 LOGIN_REDIRECT_URL
= '/'
30 AUTH_USER_MODEL
= 'accounts.Account'
32 # Local time zone for this installation. Choices can be found here:
33 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
34 # although not all choices may be available on all operating systems.
35 # In a Windows environment this must be set to your system time zone.
36 TIME_ZONE
= 'Europe/Paris'
38 # Language code for this installation. All choices can be found here:
39 # http://www.i18nguy.com/unicode/language-identifiers.html
40 LANGUAGE_CODE
= 'en-us'
42 os
.path
.join(ROOT_DIR
, 'locale'),
45 TEMPLATE_CONTEXT_PROCESSORS
= (
46 'django.contrib.auth.context_processors.auth',
47 'django.core.context_processors.debug',
48 'django.core.context_processors.i18n',
49 'django.core.context_processors.media',
50 'django.core.context_processors.static',
51 'django.core.context_processors.tz',
52 'django.contrib.messages.context_processors.messages',
53 'xnet.accounts.context_processors.xnet',
58 # If you set this to False, Django will make some optimizations so as not
59 # to load the internationalization machinery.
62 # If you set this to False, Django will not format dates, numbers and
63 # calendars according to the current locale.
66 # If you set this to False, Django will not use timezone-aware datetimes.
69 # Absolute filesystem path to the directory that will hold user-uploaded files.
70 # Example: "/home/media/media.lawrence.com/media/"
71 MEDIA_ROOT
= os
.path
.join(ROOT_DIR
, 'media')
73 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
75 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
78 # Absolute path to the directory static files should be collected to.
79 # Don't put anything in this directory yourself; store your static files
80 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
81 # Example: "/home/media/media.lawrence.com/static/"
84 # URL prefix for static files.
85 # Example: "http://media.lawrence.com/static/"
86 STATIC_URL
= '/static/'
88 # Additional locations of static files
90 os
.path
.join(ROOT_DIR
, 'static'),
91 # Put strings here, like "/home/html/static" or "C:/www/django/static".
92 # Always use forward slashes, even on Windows.
93 # Don't forget to use absolute paths, not relative paths.
96 # List of finder classes that know how to find static files in
98 STATICFILES_FINDERS
= (
99 'django.contrib.staticfiles.finders.FileSystemFinder',
100 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
101 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
104 # Make this unique, and don't share it with anybody.
105 SECRET_KEY
= 'FOR DEV ONLY!!'
107 # List of callables that know how to import templates from various sources.
109 'django.template.loaders.filesystem.Loader',
110 'django.template.loaders.app_directories.Loader',
111 # 'django.template.loaders.eggs.Loader',
114 MIDDLEWARE_CLASSES
= (
115 'django.middleware.common.CommonMiddleware',
116 'django.contrib.sessions.middleware.SessionMiddleware',
117 'django.middleware.csrf.CsrfViewMiddleware',
118 'django.contrib.auth.middleware.AuthenticationMiddleware',
119 'xnet.accounts.middleware.XnetAccountMiddleware',
120 'django.contrib.messages.middleware.MessageMiddleware',
121 # Uncomment the next line for simple clickjacking protection:
122 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
125 ROOT_URLCONF
= 'xnet.urls'
127 # Python dotted path to the WSGI application used by Django's runserver.
128 WSGI_APPLICATION
= 'xnet.wsgi.application'
131 os
.path
.join(ROOT_DIR
, 'templates'),
132 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
133 # Always use forward slashes, even on Windows.
134 # Don't forget to use absolute paths, not relative paths.
138 'django.contrib.auth',
139 'django.contrib.contenttypes',
140 'django.contrib.sessions',
141 'django.contrib.sites',
142 'django.contrib.messages',
143 'django.contrib.staticfiles',
144 'django.contrib.admin',
146 'django_authgroupex',
155 # A sample logging configuration. The only tangible logging
156 # performed by this configuration is to send an email to
157 # the site admins on every HTTP 500 error when DEBUG=False.
158 # See http://docs.djangoproject.com/en/dev/topics/logging for
159 # more details on how to customize your logging configuration.
162 'disable_existing_loggers': False,
164 'require_debug_false': {
165 '()': 'django.utils.log.RequireDebugFalse'
171 'filters': ['require_debug_false'],
172 'class': 'django.utils.log.AdminEmailHandler'
177 'handlers': ['mail_admins'],
184 CRISPY_TEMPLATE_PACK
= 'bootstrap'