Django 2.2.
[koed-quiz.git] / koedquiz / settings.py
1 # This file is part of KOED-Quiz, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
3 #
4 import os.path
5
6 PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
7
8 DEBUG = False
9
10 ADMINS = [
11     # ('Your Name', 'your_email@domain.com'),
12 ]
13
14 MANAGERS = ADMINS
15
16 DATABASES = {
17     'default': {
18         'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
19         'NAME': os.path.join(PROJECT_DIR, 'dev.db'), # Or path to database file if using sqlite3.
20         'USER': '',                      # Not used with sqlite3.
21         'PASSWORD': '',                  # Not used with sqlite3.
22         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
23         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
24     }
25 }
26
27 TIME_ZONE = 'Europe/Warsaw'
28
29 # Language code for this installation. All choices can be found here:
30 # http://www.i18nguy.com/unicode/language-identifiers.html
31 LANGUAGE_CODE = 'pl'
32
33 # If you set this to False, Django will make some optimizations so as not
34 # to load the internationalization machinery.
35 USE_I18N = True
36
37 # If you set this to False, Django will not format dates, numbers and
38 # calendars according to the current locale
39 USE_L10N = True
40
41 # Absolute filesystem path to the directory that will hold user-uploaded files.
42 # Example: "/home/media/media.lawrence.com/media/"
43 MEDIA_ROOT = os.path.join(PROJECT_DIR, '../media')
44
45 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
46 # trailing slash.
47 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
48 MEDIA_URL = '/media/'
49
50 # Absolute path to the directory static files should be collected to.
51 # Don't put anything in this directory yourself; store your static files
52 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
53 # Example: "/home/media/media.lawrence.com/static/"
54 STATIC_ROOT = os.path.join(PROJECT_DIR, 'static/')
55
56 # URL prefix for static files.
57 # Example: "http://media.lawrence.com/static/"
58 STATIC_URL = '/static/'
59
60 TEMPLATES = [
61     {
62         'BACKEND': 'django.template.backends.django.DjangoTemplates',
63         'DIRS': [
64             os.path.join(PROJECT_DIR, 'templates'),
65         ],
66         'APP_DIRS': True,
67         'OPTIONS': {
68             'context_processors': [
69                 "django.contrib.auth.context_processors.auth",
70                 "django.template.context_processors.debug",
71                 "django.template.context_processors.i18n",
72                 "django.template.context_processors.media",
73                 "django.template.context_processors.static",
74                 "django.template.context_processors.tz",
75                 "django.contrib.messages.context_processors.messages",
76                 "django.template.context_processors.request",
77             ]
78         },
79     },
80 ]
81
82 MIDDLEWARE = [
83     'django.middleware.common.CommonMiddleware',
84     'django.contrib.sessions.middleware.SessionMiddleware',
85     'django.middleware.csrf.CsrfViewMiddleware',
86     'django.contrib.auth.middleware.AuthenticationMiddleware',
87     'django.contrib.messages.middleware.MessageMiddleware',
88     'quiz.middleware.CurrentQuizMiddleware',
89 ]
90
91 ROOT_URLCONF = 'koedquiz.urls'
92
93 SITE_ID = 1
94
95 INSTALLED_APPS = [
96     'django.contrib.auth',
97     'django.contrib.contenttypes',
98     'django.contrib.sessions',
99     'django.contrib.sites',
100     'django.contrib.messages',
101     'django.contrib.staticfiles',
102
103     'django.contrib.admin',
104     'django.contrib.admindocs',
105
106     'quiz',
107 ]
108
109 # Load localsettings, if they exist
110 try:
111     from .localsettings import *
112 except ImportError:
113     pass