Cleaning some requirements.
[wolnelektury.git] / src / wolnelektury / settings / basic.py
1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
3 #
4 from os import path
5 from machina import MACHINA_MAIN_TEMPLATE_DIR
6 from .paths import PROJECT_DIR
7
8 DEBUG = True
9
10 ADMINS = [
11     # ('Your Name', 'your_email@domain.com'),
12 ]
13
14 MANAGERS = ADMINS
15
16 CONTACT_EMAIL = 'fundacja@nowoczesnapolska.org.pl'
17
18 DATABASES = {
19     'default': {
20         'ENGINE': 'django.db.backends.sqlite3',  # 'postgresql_psycopg2'
21         'NAME': path.join(PROJECT_DIR, 'dev.db'),
22         'USER': '',                      # Not used with sqlite3.
23         'PASSWORD': '',                  # Not used with sqlite3.
24         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
25     }
26 }
27
28 SOLR_TEST = "http://localhost:8983/solr/wl_test/"
29 SOLR_STOPWORDS = "/path/to/solr/data/conf/lang/stopwords_pl.txt"
30
31 # Local time zone for this installation. Choices can be found here:
32 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
33 # although not all choices may be available on all operating systems.
34 # If running in a Windows environment this must be set to the same as your
35 # system time zone.
36 TIME_ZONE = 'Europe/Warsaw'
37 USE_TZ = True
38
39 SITE_ID = 1
40
41 TEMPLATES = [{
42     'BACKEND': 'django.template.backends.django.DjangoTemplates',
43     'DIRS': (
44         path.join(PROJECT_DIR, 'templates'),  # Duplicate, because of Machina<1 weird configuration.
45         MACHINA_MAIN_TEMPLATE_DIR,
46     ),
47     'OPTIONS': {
48         'loaders': (
49             ('django.template.loaders.cached.Loader', (
50                 'django.template.loaders.filesystem.Loader',
51                 'django.template.loaders.app_directories.Loader',
52             )),
53         ),
54         'context_processors': (
55             'django.contrib.auth.context_processors.auth',
56             'django.contrib.messages.context_processors.messages',
57             'django.template.context_processors.debug',
58             'django.template.context_processors.i18n',
59             'django.template.context_processors.media',
60             'django.template.context_processors.request',
61             'wolnelektury.context_processors.extra_settings',
62             'wolnelektury.abtests.context_processor',
63             'search.context_processors.search_form',
64             'machina.core.context_processors.metadata',
65         ),
66     },
67 }]
68
69 MIDDLEWARE = [
70     'debug_toolbar.middleware.DebugToolbarMiddleware',
71     'django.middleware.csrf.CsrfViewMiddleware',
72     'django.middleware.cache.UpdateCacheMiddleware',
73     'django.middleware.common.CommonMiddleware',
74     'django.contrib.sessions.middleware.SessionMiddleware',
75     'django.contrib.auth.middleware.AuthenticationMiddleware',
76     'django.contrib.admindocs.middleware.XViewMiddleware',
77     'fnp_django_pagination.middleware.PaginationMiddleware',
78     'django.middleware.locale.LocaleMiddleware',
79     'django.middleware.common.CommonMiddleware',
80     'django.contrib.messages.middleware.MessageMiddleware',
81     'fnpdjango.middleware.SetRemoteAddrFromXRealIP',
82     'django.middleware.cache.FetchFromCacheMiddleware',
83     'machina.apps.forum_permission.middleware.ForumPermissionMiddleware',
84 ]
85
86 ROOT_URLCONF = 'wolnelektury.urls'
87
88 FILE_UPLOAD_PERMISSIONS = 0o640