Commit 13c01178 authored by Daniel STAN's avatar Daniel STAN

Copie locale qui marche sous django 1.4

parent ded976e2
......@@ -3,12 +3,8 @@
# Connexion à la base ldap
import sys
sys.path.append("/usr/scripts/gestion")
sys.path.append("/etc/crans/secrets")
from ldap_crans import crans_ldap
db = crans_ldap()
DEBUG = False
DEBUG = True
TEMPLATE_DEBUG = DEBUG
EMAIL_SUBJECT_PREFIX = "[Intranet2 Cr@ns] "
......@@ -20,24 +16,20 @@ ADMINS = (
MANAGERS = ADMINS
ROOT_PATH='/home/dstan/crans/intranet/'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'django',
'HOST': 'pgsql.adm.crans.org',
'USER': 'crans',
},
'switchs': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'switchs',
'HOST': 'pgsql.adm.crans.org',
'USER': 'crans',
},
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/home/dstan/crans/intranet/intranet.db',
'HOST': '',
'USER': '',
}
}
DATABASE_ROUTERS = [
'intranet.database.Router',
]
#DATABASE_ROUTERS = [
# 'intranet.database.Router',
# ]
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
......@@ -58,12 +50,12 @@ USE_I18N = True
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '/usr/local/django/intranet/'
MEDIA_ROOT = ROOT_PATH
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = 'https://intranet2.crans.org/'
MEDIA_URL = 'http://127.0.0.1/'
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
......@@ -71,12 +63,12 @@ MEDIA_URL = 'https://intranet2.crans.org/'
ADMIN_MEDIA_PREFIX = '/media/'
# Make this unique, and don't share it with anybody.
from secrets import django_secret_key as SECRET_KEY
SECRET_KEY='k5q7=k^)0(580foicgy%1)7*5s8oo1^1c^s%2#-s&lkt0929qc'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.load_template_source',
)
......@@ -85,12 +77,12 @@ MIDDLEWARE_CLASSES = (
'django.middleware.transaction.TransactionMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'reversion.middleware.RevisionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# 'reversion.middleware.RevisionMiddleware',
# 'django.contrib.messages.middleware.MessageMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.auth",
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
......@@ -110,32 +102,32 @@ LOGIN_URL = "/login"
LOGIN_REDIRECT_URL = "/"
AUTHENTICATION_BACKENDS = (
'intranet.login.LDAPUserBackend',
# 'intranet.login.LDAPUserBackend',
'django.contrib.auth.backends.ModelBackend',
)
INTRANET_APPS = (
{
'name':'dummy',
'category':'Beta',
'test': lambda u: u.groups.filter(name='crans_nounou'),
},
{
'name':'prises',
'category':'Administration',
'test': (lambda u: u.has_perm('prises.can_view')),
},
{
'name':'impression',
'category': 'Services',
'test': (lambda u: u.groups.filter(name='crans_nounou') or u.groups.filter(name='crans_apprenti')),
},
{
'name':'wifimap',
'category': 'Services',
'test': (lambda u: True)
}
# {
# 'name':'dummy',
# 'category':'Beta',
# 'test': lambda u: u.groups.filter(name='crans_nounou'),
# },
# {
# 'name':'prises',
# 'category':'Administration',
# 'test': (lambda u: u.has_perm('prises.can_view')),
# },
# {
# 'name':'impression',
# 'category': 'Services',
# 'test': (lambda u: u.groups.filter(name='crans_nounou') or u.groups.filter(name='crans_apprenti')),
# },
# {
# 'name':'wifimap',
# 'category': 'Services',
# 'test': (lambda u: True)
# }
)
INSTALLED_APPS = (
......@@ -145,6 +137,6 @@ INSTALLED_APPS = (
'django.contrib.messages',
'django.contrib.sites',
'django.contrib.admin',
'south',
'reversion',
#'south',
#'reversion',
) + tuple( 'intranet.apps.%s' % app['name'] for app in INTRANET_APPS )
server {
listen 80;
server_name 127.0.0.1;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8000/;
proxy_buffering off;
}
location /static {
alias /home/dstan/crans/intranet/static;
}
location /media {
alias /usr/share/pyshared/django/contrib/admin/media;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment