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