projects
/
xnet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add logout page (view, template, link)
[xnet]
/
xnet
/
settings
/
base.py
diff --git
a/xnet/settings/base.py
b/xnet/settings/base.py
index
99e7fc7
..
b595943
100644
(file)
--- a/
xnet/settings/base.py
+++ b/
xnet/settings/base.py
@@
-8,8
+8,12
@@
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def read_pass(name):
fname = os.path.join(ROOT_DIR, 'private', name)
def read_pass(name):
fname = os.path.join(ROOT_DIR, 'private', name)
- with open(fname, 'r') as f:
- return f.readline().strip()
+ try:
+ with open(fname, 'r') as f:
+ return f.readline().strip()
+ except (OSError, IOError) as e:
+ print("Unable to read %s: %s" % (fname, e))
+ return ''
ADMINS = (
# ('Your Name', 'your_email@example.com'),
ADMINS = (
# ('Your Name', 'your_email@example.com'),
@@
-17,6
+21,8
@@
ADMINS = (
MANAGERS = ADMINS
MANAGERS = ADMINS
+CONTACT_EMAIL = 'contact@polytechnique.org'
+
AUTHENTICATION_BACKENDS = (
'django_authgroupex.auth.AuthGroupeXBackend',
)
AUTHENTICATION_BACKENDS = (
'django_authgroupex.auth.AuthGroupeXBackend',
)
@@
-50,7
+56,8
@@
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.static',
'django.core.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.static',
'django.core.context_processors.tz',
'django.contrib.messages.context_processors.messages',
- 'xnet.accounts.context_processors.xnet',
+ 'xnet.site.context_processors.public_settings',
+ 'xnet.groups.context_processors.xnet',
)
SITE_ID = 1
)
SITE_ID = 1
@@
-87,7
+94,7
@@
STATIC_URL = '/static/'
# Additional locations of static files
STATICFILES_DIRS = (
# Additional locations of static files
STATICFILES_DIRS = (
- os.path.join(ROOT_DIR, 'static'),
+
#
os.path.join(ROOT_DIR, 'static'),
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
@@
-96,7
+103,7
@@
STATICFILES_DIRS = (
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
- 'django.contrib.staticfiles.finders.FileSystemFinder',
+
#
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
@@
-106,7
+113,7
@@
SECRET_KEY = 'FOR DEV ONLY!!'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.Loader',
+
#
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
@@
-116,7
+123,7
@@
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'xnet.
account
s.middleware.XnetAccountMiddleware',
+ 'xnet.
group
s.middleware.XnetAccountMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
@@
-128,13
+135,16
@@
ROOT_URLCONF = 'xnet.urls'
WSGI_APPLICATION = 'xnet.wsgi.application'
TEMPLATE_DIRS = (
WSGI_APPLICATION = 'xnet.wsgi.application'
TEMPLATE_DIRS = (
- os.path.join(ROOT_DIR, 'templates'),
+
#
os.path.join(ROOT_DIR, 'templates'),
# 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.
)
INSTALLED_APPS = (
# 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.
)
INSTALLED_APPS = (
+ # site app defines registration/ templates which overwrite other apps
+ 'xnet.site',
+
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
@@
-145,11
+155,12
@@
INSTALLED_APPS = (
'django_authgroupex',
'crispy_forms',
'django_authgroupex',
'crispy_forms',
- 'xnet.site',
+
'xnet.accounts',
'xnet.accounts',
+ 'xnet.groups',
'xnet.news',
'xnet.events',
'xnet.news',
'xnet.events',
- 'xnet.
example
',
+ 'xnet.
profiles
',
)
# A sample logging configuration. The only tangible logging
)
# A sample logging configuration. The only tangible logging