]> git.0d.be Git - earwig.git/blob - earwig/settings.py
add public login/registration system
[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 ]
44
45 MIDDLEWARE = [
46     'django.middleware.security.SecurityMiddleware',
47     'django.contrib.sessions.middleware.SessionMiddleware',
48     'django.middleware.common.CommonMiddleware',
49     'django.middleware.csrf.CsrfViewMiddleware',
50     'django.contrib.auth.middleware.AuthenticationMiddleware',
51     'django.contrib.messages.middleware.MessageMiddleware',
52     'django.middleware.clickjacking.XFrameOptionsMiddleware',
53 ]
54
55 # Serve xstatic files, required for gadjo
56 STATICFILES_FINDERS = list(global_settings.STATICFILES_FINDERS) + \
57             ['gadjo.finders.XStaticFinder']
58
59 ROOT_URLCONF = 'earwig.urls'
60
61 TEMPLATES = [
62     {
63         'BACKEND': 'django.template.backends.django.DjangoTemplates',
64         'DIRS': [
65             os.path.join(BASE_DIR, 'earwig', 'templates'),
66         ],
67         'APP_DIRS': True,
68         'OPTIONS': {
69             'context_processors': [
70                 'django.template.context_processors.debug',
71                 'django.template.context_processors.request',
72                 'django.contrib.auth.context_processors.auth',
73                 'django.contrib.messages.context_processors.messages',
74             ],
75         },
76     },
77 ]
78
79 WSGI_APPLICATION = 'earwig.wsgi.application'
80
81 AUTH_USER_MODEL = 'users.User'
82
83 # Database
84 # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
85
86 DATABASES = {
87     'default': {
88         'ENGINE': 'django.db.backends.sqlite3',
89         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
90     }
91 }
92
93
94 # Password validation
95 # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
96
97 AUTH_PASSWORD_VALIDATORS = [
98     {
99         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
100     },
101     {
102         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
103     },
104     {
105         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
106     },
107     {
108         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
109     },
110 ]
111
112
113 # Internationalization
114 # https://docs.djangoproject.com/en/1.11/topics/i18n/
115
116 LANGUAGE_CODE = 'en-us'
117
118 TIME_ZONE = 'Europe/Brussels'
119
120 USE_I18N = True
121
122 USE_L10N = True
123
124 USE_TZ = True
125
126
127 # Static files (CSS, JavaScript, Images)
128 # https://docs.djangoproject.com/en/1.11/howto/static-files/
129
130 STATIC_URL = '/static/'
131
132 # Login/registration
133 LOGIN_REDIRECT_URL = '/'
134
135
136 local_settings_file = os.environ.get('EARWIG_SETTINGS_FILE',
137         os.path.join(os.path.dirname(__file__), 'local_settings.py'))
138 if os.path.exists(local_settings_file):
139     exec(open(local_settings_file).read())