]> git.0d.be Git - earwig.git/blob - earwig/settings.py
start management interface
[earwig.git] / earwig / settings.py
1 """
2 Django settings for earwig project.
3
4 For more information on this file, see
5 https://docs.djangoproject.com/en/1.11/topics/settings/
6
7 For the full list of settings and their values, see
8 https://docs.djangoproject.com/en/1.11/ref/settings/
9 """
10
11 import os
12 from django.conf import global_settings
13
14 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
15 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
16
17
18 # Quick-start development settings - unsuitable for production
19 # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
20
21 # SECURITY WARNING: keep the secret key used in production secret!
22 SECRET_KEY = 'tlr6=af(#1hrb&@s)gwesw=-%#fh^3msr9y&*qmf+se_x-o-7t'
23
24 # SECURITY WARNING: don't run with debug turned on in production!
25 DEBUG = True
26
27 ALLOWED_HOSTS = []
28
29
30 # Application definition
31
32 INSTALLED_APPS = [
33     'django.contrib.admin',
34     'registration',
35     'django.contrib.auth',
36     'django.contrib.contenttypes',
37     'django.contrib.sessions',
38     'django.contrib.messages',
39     'django.contrib.staticfiles',
40     'gadjo',
41     'earwig.sounds',
42     'earwig.users',
43     'earwig.manager',
44 ]
45
46 MIDDLEWARE = [
47     'django.middleware.security.SecurityMiddleware',
48     'django.contrib.sessions.middleware.SessionMiddleware',
49     'django.middleware.common.CommonMiddleware',
50     'django.middleware.csrf.CsrfViewMiddleware',
51     'django.contrib.auth.middleware.AuthenticationMiddleware',
52     'django.contrib.messages.middleware.MessageMiddleware',
53     'django.middleware.clickjacking.XFrameOptionsMiddleware',
54 ]
55
56 # Serve xstatic files, required for gadjo
57 STATICFILES_FINDERS = list(global_settings.STATICFILES_FINDERS) + \
58             ['gadjo.finders.XStaticFinder']
59
60 ROOT_URLCONF = 'earwig.urls'
61
62 TEMPLATES = [
63     {
64         'BACKEND': 'django.template.backends.django.DjangoTemplates',
65         'DIRS': [
66             os.path.join(BASE_DIR, 'earwig', 'templates'),
67         ],
68         'APP_DIRS': True,
69         'OPTIONS': {
70             'context_processors': [
71                 'django.template.context_processors.debug',
72                 'django.template.context_processors.request',
73                 'django.contrib.auth.context_processors.auth',
74                 'django.contrib.messages.context_processors.messages',
75             ],
76         },
77     },
78 ]
79
80 WSGI_APPLICATION = 'earwig.wsgi.application'
81
82 AUTH_USER_MODEL = 'users.User'
83
84 # Database
85 # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
86
87 DATABASES = {
88     'default': {
89         'ENGINE': 'django.db.backends.sqlite3',
90         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
91     }
92 }
93
94
95 # Password validation
96 # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
97
98 AUTH_PASSWORD_VALIDATORS = [
99     {
100         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
101     },
102     {
103         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
104     },
105     {
106         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
107     },
108     {
109         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
110     },
111 ]
112
113
114 # Internationalization
115 # https://docs.djangoproject.com/en/1.11/topics/i18n/
116
117 LANGUAGE_CODE = 'en-us'
118
119 TIME_ZONE = 'Europe/Brussels'
120
121 USE_I18N = True
122
123 USE_L10N = True
124
125 USE_TZ = True
126
127
128 # Static files (CSS, JavaScript, Images)
129 # https://docs.djangoproject.com/en/1.11/howto/static-files/
130
131 STATIC_URL = '/static/'
132
133 # Login/registration
134 LOGIN_REDIRECT_URL = '/'
135
136
137 local_settings_file = os.environ.get('EARWIG_SETTINGS_FILE',
138         os.path.join(os.path.dirname(__file__), 'local_settings.py'))
139 if os.path.exists(local_settings_file):
140     exec(open(local_settings_file).read())