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