1 # Django settings for xnet project.
7 ROOT_DIR
= os
.path
.abspath(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'),
22 'ENGINE': 'django.db.backends.sqlite3',
23 'NAME': os
.path
.join(ROOT_DIR
, 'db.sqlite'),
27 AUTHENTICATION_BACKENDS
= (
28 'django_authgroupex.auth.AuthGroupeXBackend',
30 AUTHGROUPEX_KEY
= read_pass('authgroupex.key')
31 AUTHGROUPEX_FIELDS
= ('username', 'firstname', 'lastname', 'perms')
32 AUTHGROUPEX_SUPERADMIN_PERMS
= ('admin',)
33 LOGIN_URL
= '/xorgauth/'
34 LOGIN_REDIRECT_URL
= '/'
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.
40 TIME_ZONE
= 'Europe/Paris'
42 # Language code for this installation. All choices can be found here:
43 # http://www.i18nguy.com/unicode/language-identifiers.html
44 LANGUAGE_CODE
= 'en-us'
46 os
.path
.join(ROOT_DIR
, 'locale'),
52 # If you set this to False, Django will make some optimizations so as not
53 # to load the internationalization machinery.
56 # If you set this to False, Django will not format dates, numbers and
57 # calendars according to the current locale.
60 # If you set this to False, Django will not use timezone-aware datetimes.
63 # Absolute filesystem path to the directory that will hold user-uploaded files.
64 # Example: "/home/media/media.lawrence.com/media/"
67 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
69 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
72 # Absolute path to the directory static files should be collected to.
73 # Don't put anything in this directory yourself; store your static files
74 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
75 # Example: "/home/media/media.lawrence.com/static/"
78 # URL prefix for static files.
79 # Example: "http://media.lawrence.com/static/"
80 STATIC_URL
= '/static/'
82 # Additional locations of static files
84 os
.path
.join(ROOT_DIR
, 'static'),
85 # Put strings here, like "/home/html/static" or "C:/www/django/static".
86 # Always use forward slashes, even on Windows.
87 # Don't forget to use absolute paths, not relative paths.
90 # List of finder classes that know how to find static files in
92 STATICFILES_FINDERS
= (
93 'django.contrib.staticfiles.finders.FileSystemFinder',
94 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
95 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
98 # Make this unique, and don't share it with anybody.
99 SECRET_KEY
= 'iq9w_94mr$p$a3sr%*cnvt8z($-)zjk1o8wx45dw(6z3%(mwzo'
101 # List of callables that know how to import templates from various sources.
103 'django.template.loaders.filesystem.Loader',
104 'django.template.loaders.app_directories.Loader',
105 # 'django.template.loaders.eggs.Loader',
108 MIDDLEWARE_CLASSES
= (
109 'django.middleware.common.CommonMiddleware',
110 'django.contrib.sessions.middleware.SessionMiddleware',
111 'django.middleware.csrf.CsrfViewMiddleware',
112 'django.contrib.auth.middleware.AuthenticationMiddleware',
113 'django.contrib.messages.middleware.MessageMiddleware',
114 # Uncomment the next line for simple clickjacking protection:
115 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
118 ROOT_URLCONF
= 'xnet.urls'
120 # Python dotted path to the WSGI application used by Django's runserver.
121 WSGI_APPLICATION
= 'xnet.wsgi.application'
124 os
.path
.join(ROOT_DIR
, 'templates'),
125 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
126 # Always use forward slashes, even on Windows.
127 # Don't forget to use absolute paths, not relative paths.
131 'django.contrib.auth',
132 'django.contrib.contenttypes',
133 'django.contrib.sessions',
134 'django.contrib.sites',
135 'django.contrib.messages',
136 'django.contrib.staticfiles',
137 'django.contrib.admin',
139 'django_authgroupex',
145 # A sample logging configuration. The only tangible logging
146 # performed by this configuration is to send an email to
147 # the site admins on every HTTP 500 error when DEBUG=False.
148 # See http://docs.djangoproject.com/en/dev/topics/logging for
149 # more details on how to customize your logging configuration.
152 'disable_existing_loggers': False,
154 'require_debug_false': {
155 '()': 'django.utils.log.RequireDebugFalse'
161 'filters': ['require_debug_false'],
162 'class': 'django.utils.log.AdminEmailHandler'
167 'handlers': ['mail_admins'],