fix
[wolnelektury.git] / src / wolnelektury / settings / basic.py
1 # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
3 #
4 import os
5
6 DEBUG = True
7
8 ADMINS = [
9     # ('Your Name', 'your_email@domain.com'),
10 ]
11
12 MANAGERS = ADMINS
13
14 CONTACT_EMAIL = 'fundacja@wolnelektury.pl'
15
16 ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split()
17
18 CACHE_MIDDLEWARE_SECONDS = 3 * 60
19
20 DATABASES = {
21     'default': {
22         'ENGINE': 'django.db.backends.postgresql',
23         'HOST': 'db',
24         'USER': os.environ.get('POSTGRES_USER'),
25         'PASSWORD': os.environ.get('POSTGRES_PASSWORD'),
26         'NAME': os.environ.get('POSTGRES_USER'),
27     }
28 }
29
30 DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
31
32 # Local time zone for this installation. Choices can be found here:
33 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
34 # although not all choices may be available on all operating systems.
35 # If running in a Windows environment this must be set to the same as your
36 # system time zone.
37 TIME_ZONE = 'Europe/Warsaw'
38 USE_TZ = True
39
40 SITE_ID = 1
41
42 TEMPLATES = [{
43     'BACKEND': 'django.template.backends.django.DjangoTemplates',
44     'APP_DIRS': True,
45     'OPTIONS': {
46         'context_processors': (
47             'django.contrib.auth.context_processors.auth',
48             'django.contrib.messages.context_processors.messages',
49             'django.template.context_processors.debug',
50             'django.template.context_processors.i18n',
51             'django.template.context_processors.media',
52             'django.template.context_processors.request',
53             'wolnelektury.context_processors.extra_settings',
54         ),
55     },
56 }]
57
58 MIDDLEWARE = [
59     'debug_toolbar.middleware.DebugToolbarMiddleware',
60     'django.middleware.csrf.CsrfViewMiddleware',
61     'django.middleware.cache.UpdateCacheMiddleware',
62     'django.middleware.common.CommonMiddleware',
63     'django.contrib.sessions.middleware.SessionMiddleware',
64     'django.contrib.auth.middleware.AuthenticationMiddleware',
65     'django.contrib.admindocs.middleware.XViewMiddleware',
66     'fnp_django_pagination.middleware.PaginationMiddleware',
67     'django.middleware.locale.LocaleMiddleware',
68     'django.middleware.common.CommonMiddleware',
69     'django.contrib.messages.middleware.MessageMiddleware',
70     'fnpdjango.middleware.SetRemoteAddrFromXRealIP',
71     'django.middleware.cache.FetchFromCacheMiddleware',
72     'experiments.middleware.experiments_middleware',
73 ]
74
75 ROOT_URLCONF = 'wolnelektury.urls'
76
77 FILE_UPLOAD_PERMISSIONS = 0o640