configured django-cms for testing purposes
[unfold.git] / myslice / settings.py
1 # -*- coding: utf-8 -*-
2 # Django settings for myslice project.
3
4 import os
5 gettext = lambda s: s
6 PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
7
8 import os.path
9
10 DEBUG = True
11 TEMPLATE_DEBUG = DEBUG
12
13 # compute ROOT from where this file is installed
14 # should fit every need including developers
15 # but you can redefine ROOT if that's not working for you
16 try:
17     # get the directory where this file is
18     ROOT=os.path.dirname(__file__) or '.'
19     # move one step up
20     ROOT=os.path.realpath(ROOT+'/..')
21 except:
22     ROOT=None
23     if DEBUG:
24         import traceback
25         traceback.print_exc()
26
27 if not ROOT:
28     raise Exception,"Cannot find ROOT for myslice"
29
30 ####################
31 ADMINS = (
32     ('admin', 'your_email@test.com'),
33 )
34
35 MANAGERS = ADMINS
36
37 # Mail configuration
38 #DEFAULT_FROM_EMAIL = "root@theseus.ipv6.lip6.fr"
39 #EMAIL_HOST_PASSWORD = "mypassword"
40
41 EMAIL_HOST = "localhost"
42 EMAIL_PORT = 25
43 EMAIL_USE_TLS = False
44
45 DATABASES = {
46     'default': {
47         'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
48         'NAME': os.path.join(ROOT,'myslice.sqlite3'), # Or path to database file if using sqlite3.
49         'USER': '',                      # Not used with sqlite3.
50         'PASSWORD': '',                  # Not used with sqlite3.
51         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
52         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
53     }
54 }
55
56 # Local time zone for this installation. Choices can be found here:
57 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
58 # although not all choices may be available on all operating systems.
59 # In a Windows environment this must be set to your system time zone.
60 TIME_ZONE = 'America/Chicago'
61
62 # Language code for this installation. All choices can be found here:
63 # http://www.i18nguy.com/unicode/language-identifiers.html
64 LANGUAGE_CODE = 'en-us'
65
66 SITE_ID = 1
67
68 # If you set this to False, Django will make some optimizations so as not
69 # to load the internationalization machinery.
70 USE_I18N = True
71
72 # If you set this to False, Django will not format dates, numbers and
73 # calendars according to the current locale.
74 USE_L10N = True
75
76 # If you set this to False, Django will not use timezone-aware datetimes.
77 USE_TZ = True
78
79 # Absolute filesystem path to the directory that will hold user-uploaded files.
80 # Example: "/home/media/media.lawrence.com/media/"
81 MEDIA_ROOT = ''
82
83 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
84 # trailing slash.
85 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
86 MEDIA_URL = ''
87
88 # Absolute path to the directory static files should be collected to.
89 # Don't put anything in this directory yourself; store your static files
90 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
91 # Example: "/home/media/media.lawrence.com/static/"
92 STATIC_ROOT = os.path.join(ROOT,'django-static')
93
94 # URL prefix for static files.
95 # Example: "http://media.lawrence.com/static/"
96 STATIC_URL = '/all-static/'
97
98 # Additional locations of static files
99 STATICFILES_DIRS = (
100     # Put strings here, like "/home/html/static" or "C:/www/django/static".
101     # Always use forward slashes, even on Windows.
102     # Don't forget to use absolute paths, not relative paths.
103     os.path.join(ROOT,'all-static'),
104 )
105
106 # List of finder classes that know how to find static files in
107 # various locations.
108 STATICFILES_FINDERS = (
109     'django.contrib.staticfiles.finders.FileSystemFinder',
110     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
111 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
112 )
113
114 # Make this unique, and don't share it with anybody.
115 SECRET_KEY = 't%n(3h)&r^n8(+8)(sp29t^$c2#t(m3)e2!02l8w1#36tl#t27'
116
117 # List of callables that know how to import templates from various sources.
118 TEMPLATE_LOADERS = (
119     'django.template.loaders.filesystem.Loader',
120     'django.template.loaders.app_directories.Loader',
121 #     'django.template.loaders.eggs.Loader',
122 )
123
124 MIDDLEWARE_CLASSES = (
125     'django.middleware.common.CommonMiddleware',
126     'django.contrib.sessions.middleware.SessionMiddleware',
127     'django.middleware.csrf.CsrfViewMiddleware',
128     'django.contrib.auth.middleware.AuthenticationMiddleware',
129     'django.contrib.messages.middleware.MessageMiddleware',
130     # Uncomment the next line for simple clickjacking protection:
131     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
132
133     'django.middleware.locale.LocaleMiddleware',
134     'django.middleware.doc.XViewMiddleware',
135
136     # CMS
137     'cms.middleware.page.CurrentPageMiddleware',
138     'cms.middleware.user.CurrentUserMiddleware',
139     'cms.middleware.toolbar.ToolbarMiddleware',
140     'cms.middleware.language.LanguageCookieMiddleware',
141 )
142
143 # CMS
144 TEMPLATE_CONTEXT_PROCESSORS = (
145     'django.contrib.auth.context_processors.auth',
146     'django.core.context_processors.i18n',
147     'django.core.context_processors.request',
148     'django.core.context_processors.media',
149     'django.core.context_processors.static',
150     'cms.context_processors.media',
151     'sekizai.context_processors.sekizai',
152 )
153
154
155 ROOT_URLCONF = 'myslice.urls'
156
157 # Python dotted path to the WSGI application used by Django's runserver.
158 WSGI_APPLICATION = 'myslice.wsgi.application'
159
160 TEMPLATE_DIRS = (
161     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
162     # Always use forward slashes, even on Windows.
163     # Don't forget to use absolute paths, not relative paths.
164     os.path.join(ROOT,"all-templates"),
165
166     # CMS
167     os.path.join(PROJECT_PATH, "templates"),
168 )
169
170 # CMS
171 CMS_TEMPLATES = (
172     ('template_1.html', 'Template One'),
173     ('template_2.html', 'Template Two'),
174 )
175
176 LANGUAGES = [
177     ('en', 'English'),
178 ]
179
180 INSTALLED_APPS = (
181     'django.contrib.auth',
182     'django.contrib.contenttypes',
183     'django.contrib.sessions',
184     'django.contrib.sites',
185     'django.contrib.messages',
186     'django.contrib.staticfiles',
187     # handling the {% insert %} and {% container %} tags
188     # see details in devel/django-insert-above-1.0-4
189     'insert_above',
190     # our django project
191     'myslice',
192     # the core of the UI
193     'auth', 'manifold', 'unfold',
194     # plugins
195     'plugins',
196     # views - more or less stable 
197     'views',
198     'trash',
199     # Uncomment the next line to enable the admin:
200     'django.contrib.admin',
201     # Uncomment the next line to enable admin documentation:
202     # 'django.contrib.admindocs',
203     'portal',
204 # DEPRECATED #    'django.contrib.formtools',
205 # DEPRECATED ##    'crispy_forms',
206 # DEPRECATED #
207 # DEPRECATED #    # User registration
208 # DEPRECATED #    'django.contrib.auth',
209 # DEPRECATED #    'django.contrib.sites',
210 # DEPRECATED #    'registration',
211
212     # CMS : Django CMS
213     'cms',     # django CMS itself
214     'mptt',    # utilities for implementing a modified pre-order traversal tree
215     'menus',   # helper for model independent hierarchical website navigation
216     'south',   # intelligent schema and data migrations
217     'sekizai', # for javascript and css management
218     # + plugins:
219     'cms.plugins.flash',
220     'cms.plugins.googlemap',
221     'cms.plugins.link',
222     'cms.plugins.snippet',
223     'cms.plugins.text',
224     'cms.plugins.twitter',
225     # either
226     'cms.plugins.file',
227     'cms.plugins.picture',
228     'cms.plugins.teaser',
229     'cms.plugins.video',
230     # or
231     #'filer',
232     #'cmsplugin_filer_file',
233     #'cmsplugin_filer_folder',
234     #'cmsplugin_filer_image',
235     #'cmsplugin_filer_teaser',
236     #'cmsplugin_filer_video',
237
238     # Versioning of content 
239     #'reversion',
240 )
241
242 ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window; you may, of course, use a different value.
243
244 # A sample logging configuration. The only tangible logging
245 # performed by this configuration is to send an email to
246 # the site admins on every HTTP 500 error when DEBUG=False.
247 # See http://docs.djangoproject.com/en/dev/topics/logging for
248 # more details on how to customize your logging configuration.
249 LOGGING = {
250     'version': 1,
251     'disable_existing_loggers': False,
252     'filters': {
253         'require_debug_false': {
254             '()': 'django.utils.log.RequireDebugFalse'
255         }
256     },
257     'handlers': {
258         'mail_admins': {
259             'level': 'ERROR',
260             'filters': ['require_debug_false'],
261             'class': 'django.utils.log.AdminEmailHandler',
262         }
263     },
264     'loggers': {
265         'django.request': {
266             'handlers': ['mail_admins'],
267             'level': 'ERROR',
268             'propagate': True,
269         },
270     }
271 }
272
273 AUTHENTICATION_BACKENDS = (
274     'auth.backend.MyCustomBackend',
275     'auth.manifoldbackend.ManifoldBackend', 
276     # This is required to login as an admin
277     'django.contrib.auth.backends.ModelBackend' 
278 )
279
280 ### the view to redirect malformed (i.e. with a wrong CSRF) incoming requests
281 # without this setting django will return a 403 forbidden error, which is fine
282 # if you need to see the error message then use this setting
283 CSRF_FAILURE_VIEW = 'manifold.manifoldproxy.csrf_failure'
284
285 #################### for insert_above
286 #IA_JS_FORMAT = "<script type='text/javascript' src='{URL}' />"
287 # put stuff under static/
288 # IA_MEDIA_PREFIX = '/code/'
289