Updates.
[audio.git] / src / audiobooks / settings.py
1 # Django settings for audiobooks project.
2
3 import os
4 PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
5
6
7
8 DEBUG = False
9
10 ADMINS = (
11     # ('Your Name', 'your_email@example.com'),
12 )
13
14 MANAGERS = ADMINS
15
16 DATABASES = {
17     'default': {
18         'ENGINE': 'django.db.backends.postgresql',
19         'NAME': 'audio',
20     }
21 }
22
23 # Local time zone for this installation. Choices can be found here:
24 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
25 # although not all choices may be available on all operating systems.
26 # On Unix systems, a value of None will cause Django to use the same
27 # timezone as the operating system.
28 # If running in a Windows environment this must be set to the same as your
29 # system time zone.
30 TIME_ZONE = 'Europe/Warsaw'
31
32 # Language code for this installation. All choices can be found here:
33 # http://www.i18nguy.com/unicode/language-identifiers.html
34 LANGUAGE_CODE = 'pl'
35
36 SITE_ID = 1
37
38 # If you set this to False, Django will make some optimizations so as not
39 # to load the internationalization machinery.
40 USE_I18N = True
41
42 # If you set this to False, Django will not format dates, numbers and
43 # calendars according to the current locale
44 USE_L10N = True
45
46 # Absolute filesystem path to the directory that will hold user-uploaded files.
47 # Example: "/home/media/media.lawrence.com/media/"
48 MEDIA_ROOT = os.path.join(PROJECT_ROOT, '../media/')
49
50 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
51 # trailing slash.
52 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
53 MEDIA_URL = '/media/'
54
55 # Absolute path to the directory static files should be collected to.
56 # Don't put anything in this directory yourself; store your static files
57 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
58 # Example: "/home/media/media.lawrence.com/static/"
59 STATIC_ROOT = ''
60
61 # URL prefix for static files.
62 # Example: "http://media.lawrence.com/static/"
63 STATIC_URL = '/static/'
64
65 # URL prefix for admin static files -- CSS, JavaScript and images.
66 # Make sure to use a trailing slash.
67 # Examples: "http://foo.com/static/admin/", "/static/admin/".
68 ADMIN_MEDIA_PREFIX = '/static/admin/'
69
70 # Additional locations of static files
71 STATICFILES_DIRS = (
72     # Put strings here, like "/home/html/static" or "C:/www/django/static".
73     # Always use forward slashes, even on Windows.
74     # Don't forget to use absolute paths, not relative paths.
75 )
76
77 # List of finder classes that know how to find static files in
78 # various locations.
79 STATICFILES_FINDERS = (
80     'django.contrib.staticfiles.finders.FileSystemFinder',
81     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
82 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
83 )
84
85 # Make this unique, and don't share it with anybody.
86 SECRET_KEY = '8ehk^-+pr(o)k6lh_gl9+ks6gkd9u#fka7fv%ikpk(c%llqa6%'
87
88 TEMPLATES = [
89     {
90         'BACKEND': 'django.template.backends.django.DjangoTemplates',
91         'APP_DIRS': True,
92         'OPTIONS': {
93             'context_processors': [
94                 'django.template.context_processors.debug',
95                 'django.template.context_processors.request',
96                 'django.contrib.auth.context_processors.auth',
97                 'django.contrib.messages.context_processors.messages',
98             ],
99         },
100     },
101 ]
102
103 MIDDLEWARE = (
104     'django.middleware.common.CommonMiddleware',
105     'django.contrib.sessions.middleware.SessionMiddleware',
106     'django.middleware.csrf.CsrfViewMiddleware',
107     'django.contrib.auth.middleware.AuthenticationMiddleware',
108     'django_cas_ng.middleware.CASMiddleware',
109     'django.contrib.messages.middleware.MessageMiddleware',
110 )
111
112 AUTHENTICATION_BACKENDS = (
113     'django.contrib.auth.backends.ModelBackend',
114     'django_cas_ng.backends.CASBackend',
115 )
116
117 ROOT_URLCONF = 'audiobooks.urls'
118
119 INSTALLED_APPS = (
120     'django.contrib.auth',
121     'django.contrib.contenttypes',
122     'django.contrib.sessions',
123     'django.contrib.sites',
124     'django.contrib.messages',
125     'django.contrib.staticfiles',
126     'django.contrib.admin',
127     # Uncomment the next line to enable admin documentation:
128     # 'django.contrib.admindocs',
129     'bootstrap4',
130     'django_cas_ng',
131
132     'apiclient',
133     'archive',
134 )
135
136 # A sample logging configuration. The only tangible logging
137 # performed by this configuration is to send an email to
138 # the site admins on every HTTP 500 error.
139 # See http://docs.djangoproject.com/en/dev/topics/logging for
140 # more details on how to customize your logging configuration.
141 LOGGING = {
142     'version': 1,
143     'disable_existing_loggers': False,
144     'filters': {
145          'require_debug_false': {
146              '()': 'django.utils.log.RequireDebugFalse'
147          }
148      },
149     'handlers': {
150         'mail_admins': {
151             'level': 'ERROR',
152             'filters': ['require_debug_false'],
153             'class': 'django.utils.log.AdminEmailHandler'
154         }
155     },
156     'loggers': {
157         'django.request': {
158             'handlers': ['mail_admins'],
159             'level': 'ERROR',
160             'propagate': True,
161         },
162     }
163 }
164
165 CAS_SERVER_URL = "https://logowanie.nowoczesnapolska.org.pl/cas/"
166 CAS_VERSION = "2"
167
168 EMAIL_SUBJECT_PREFIX = '[Audio] '
169 SERVER_EMAIL = 'no-reply@audio.wolnelektury.pl'
170 EMAIL_HOST = 'localhost'
171 EMAIL_PORT = 25
172
173 CELERY_BROKER_URL = 'redis://localhost:6379/0'
174
175 try:
176     from .localsettings import *
177 except:
178     pass