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