X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=xnet%2Fsettings%2Fbase.py;h=b5959431f1b1d7f05a1e29bb6e4db13e0ad5c13e;hb=1564d2a521e1e2172b3c3579ceda86c9aceab47e;hp=99e7fc7794957e59029451df88a231cf66db779e;hpb=687bfc77b9c765aa8c8e0eb99f5cb665d03bc422;p=xnet diff --git a/xnet/settings/base.py b/xnet/settings/base.py index 99e7fc7..b595943 100644 --- 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) - 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'), @@ -17,6 +21,8 @@ ADMINS = ( MANAGERS = ADMINS +CONTACT_EMAIL = 'contact@polytechnique.org' + 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', - 'xnet.accounts.context_processors.xnet', + 'xnet.site.context_processors.public_settings', + 'xnet.groups.context_processors.xnet', ) SITE_ID = 1 @@ -87,7 +94,7 @@ STATIC_URL = '/static/' # 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. @@ -96,7 +103,7 @@ STATICFILES_DIRS = ( # 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', ) @@ -106,7 +113,7 @@ SECRET_KEY = 'FOR DEV ONLY!!' # 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', ) @@ -116,7 +123,7 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'xnet.accounts.middleware.XnetAccountMiddleware', + 'xnet.groups.middleware.XnetAccountMiddleware', '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 = ( - 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 = ( + # site app defines registration/ templates which overwrite other apps + 'xnet.site', + 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', @@ -145,11 +155,12 @@ INSTALLED_APPS = ( 'django_authgroupex', 'crispy_forms', - 'xnet.site', + 'xnet.accounts', + 'xnet.groups', 'xnet.news', 'xnet.events', - 'xnet.example', + 'xnet.profiles', ) # A sample logging configuration. The only tangible logging