settings.py 4.15 KB
Newer Older
1 2
#!/usr/bin/env python
# coding: utf-8
3
# Django settings for Nuages
christophe siraut's avatar
christophe siraut committed
4
import os
5
import socket
christophe siraut's avatar
christophe siraut committed
6

7
DEBUG = False
8
TEMPLATE_DEBUG = DEBUG
9 10 11 12 13

SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
ALLOWED_HOSTS = [socket.getfqdn()]

14
ADMINS = (
15
    ('Nuages', 'nuages@lists.domainepublic.net'),
16 17
)
MANAGERS = ADMINS
chris's avatar
chris committed
18
DEFAULT_FROM_EMAIL = 'nuages@domainepublic.net'
19
LOGIN_REDIRECT_URL = '/'
20
PROJECT_DIR = os.path.dirname(os.path.dirname(__file__))
21

Christophe Siraut's avatar
Christophe Siraut committed
22 23
DATABASES = {
    'default': {
Christophe Siraut's avatar
Christophe Siraut committed
24
        'ENGINE': 'django.db.backends.sqlite3',
25
        'NAME': '/var/lib/nuages/db.sqlite',
Christophe Siraut's avatar
Christophe Siraut committed
26 27 28 29
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
Christophe Siraut's avatar
Christophe Siraut committed
30 31
    },
}
32

Christophe Siraut's avatar
Christophe Siraut committed
33 34
ACCOUNT_ACTIVATION_DAYS = 7  # Activation window

35 36 37 38 39
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
christophe siraut's avatar
christophe siraut committed
40
TIME_ZONE = 'Europe/Brussels'
41 42 43 44 45

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

46
LANGUAGES = (
47 48 49 50
    ('fr', u'Français'),
    ('en', u'English'),
    ('nl', u'Nederlands'),
    ('ca', u'Català')
51 52
)

53 54 55 56 57 58
SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

Christophe Siraut's avatar
Christophe Siraut committed
59 60 61
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''
62 63 64

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
Christophe Siraut's avatar
Christophe Siraut committed
65 66 67 68 69 70 71
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = ''

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
72
STATIC_ROOT = os.path.join(PROJECT_DIR, 'staticroot')
Christophe Siraut's avatar
Christophe Siraut committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
    # 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.
)

# 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.AppDirectoriesFinder',
90
    #'django.contrib.staticfiles.finders.DefaultStorageFinder',
Christophe Siraut's avatar
Christophe Siraut committed
91
)
92 93

# Make this unique, and don't share it with anybody.
94
SECRET_KEY = '3qm&@6264-=st16)7_xa*ds+31e0mqqs@+*!ud7gzt$tq!b^qn'
95 96 97

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
Christophe Siraut's avatar
Christophe Siraut committed
98 99
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
100
    #'django.template.loaders.eggs.load_template_source',
101 102 103 104
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
105
    'django.middleware.locale.LocaleMiddleware',
106 107
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
108
    'django.contrib.auth.middleware.AuthenticationMiddleware',
Christophe Siraut's avatar
Christophe Siraut committed
109 110
    'django.contrib.messages.middleware.MessageMiddleware',
    #'request.middleware.RequestMiddleware',
111 112
)

113
ROOT_URLCONF = 'nuages.urls'
114 115

TEMPLATE_DIRS = (
116
    # Put strings here, like "/home/html/django_templates".
117 118 119 120 121 122 123 124 125
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
Christophe Siraut's avatar
Christophe Siraut committed
126 127
    'django.contrib.messages',
    'django.contrib.staticfiles',
chris's avatar
chris committed
128 129
    'django.contrib.admin',
    'django.contrib.admindocs',
Christophe Siraut's avatar
Christophe Siraut committed
130
    'jquery',
Christophe Siraut's avatar
Christophe Siraut committed
131
    'registration',
Christophe Siraut's avatar
Christophe Siraut committed
132 133 134
    'datetimewidget',
    'django_bootstrap_staticfiles',
    'nuages_templates',
Christophe Siraut's avatar
Christophe Siraut committed
135
    'registration_templates',
136
    'meetingpoll',
137
)
138 139

try:
140
    from local_settings import *
141
except ImportError, e:
142
    pass