a7bc662a8b56b7f74a9c8fc2f407a5230e8fe1ea
[myslice.git] / myslice / settings.py
1 # Django settings for myslice project.
2
3 import os.path
4
5 DEBUG = True
6 TEMPLATE_DEBUG = DEBUG
7
8 # compute ROOT from where this file is installed
9 # should fit every need including developers
10 # but you can redefine ROOT if that's not working for you
11 try:
12     # get the directory where this file is
13     ROOT=os.path.dirname(__file__) or '.'
14     # move one step up
15     ROOT=os.path.realpath(ROOT+'/..')
16 except:
17     ROOT=None
18     if DEBUG:
19         import traceback
20         traceback.print_exc()
21
22 if not ROOT:
23     raise Exception,"Cannot find ROOT for myslice"
24
25 ####################
26 ADMINS = (
27     # ('Your Name', 'your_email@example.com'),
28 )
29
30 MANAGERS = ADMINS
31
32 # Mail configuration
33 EMAIL_HOST         = 'tibre.lip6.fr'
34 EMAIL_PORT         = 465
35 DEFAULT_FROM_EMAIL = "support@myslice.info"
36
37 DATABASES = {
38     'default': {
39         'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
40         'NAME': os.path.join(ROOT,'myslice.sqlite3'), # Or path to database file if using sqlite3.
41         'USER': '',                      # Not used with sqlite3.
42         'PASSWORD': '',                  # Not used with sqlite3.
43         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
44         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
45     }
46 }
47
48 # Local time zone for this installation. Choices can be found here:
49 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
50 # although not all choices may be available on all operating systems.
51 # In a Windows environment this must be set to your system time zone.
52 TIME_ZONE = 'America/Chicago'
53
54 # Language code for this installation. All choices can be found here:
55 # http://www.i18nguy.com/unicode/language-identifiers.html
56 LANGUAGE_CODE = 'en-us'
57
58 SITE_ID = 1
59
60 # If you set this to False, Django will make some optimizations so as not
61 # to load the internationalization machinery.
62 USE_I18N = True
63
64 # If you set this to False, Django will not format dates, numbers and
65 # calendars according to the current locale.
66 USE_L10N = True
67
68 # If you set this to False, Django will not use timezone-aware datetimes.
69 USE_TZ = True
70
71 # Absolute filesystem path to the directory that will hold user-uploaded files.
72 # Example: "/home/media/media.lawrence.com/media/"
73 MEDIA_ROOT = ''
74
75 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
76 # trailing slash.
77 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
78 MEDIA_URL = ''
79
80 # Absolute path to the directory static files should be collected to.
81 # Don't put anything in this directory yourself; store your static files
82 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
83 # Example: "/home/media/media.lawrence.com/static/"
84 STATIC_ROOT = os.path.join(ROOT,'django-static')
85
86 # URL prefix for static files.
87 # Example: "http://media.lawrence.com/static/"
88 STATIC_URL = '/all-static/'
89
90 # Additional locations of static files
91 STATICFILES_DIRS = (
92     # Put strings here, like "/home/html/static" or "C:/www/django/static".
93     # Always use forward slashes, even on Windows.
94     # Don't forget to use absolute paths, not relative paths.
95     os.path.join(ROOT,'all-static'),
96 )
97
98 # List of finder classes that know how to find static files in
99 # various locations.
100 STATICFILES_FINDERS = (
101     'django.contrib.staticfiles.finders.FileSystemFinder',
102     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
103 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
104 )
105
106 # Make this unique, and don't share it with anybody.
107 SECRET_KEY = 't%n(3h)&r^n8(+8)(sp29t^$c2#t(m3)e2!02l8w1#36tl#t27'
108
109 # List of callables that know how to import templates from various sources.
110 TEMPLATE_LOADERS = (
111     'django.template.loaders.filesystem.Loader',
112     'django.template.loaders.app_directories.Loader',
113 #     'django.template.loaders.eggs.Loader',
114 )
115
116 MIDDLEWARE_CLASSES = (
117     'django.middleware.common.CommonMiddleware',
118     'django.contrib.sessions.middleware.SessionMiddleware',
119     'django.middleware.csrf.CsrfViewMiddleware',
120     'django.contrib.auth.middleware.AuthenticationMiddleware',
121     'django.contrib.messages.middleware.MessageMiddleware',
122     # Uncomment the next line for simple clickjacking protection:
123     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
124 )
125
126 ROOT_URLCONF = 'myslice.urls'
127
128 # Python dotted path to the WSGI application used by Django's runserver.
129 WSGI_APPLICATION = 'myslice.wsgi.application'
130
131 TEMPLATE_DIRS = (
132     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
133     # Always use forward slashes, even on Windows.
134     # Don't forget to use absolute paths, not relative paths.
135     os.path.join(ROOT,"all-templates"),
136 )
137
138 INSTALLED_APPS = (
139     'django.contrib.auth',
140     'django.contrib.contenttypes',
141     'django.contrib.sessions',
142     'django.contrib.sites',
143     'django.contrib.messages',
144     'django.contrib.staticfiles',
145     # handling the {% insert %} and {% container %} tags
146     # see details in devel/django-insert-above-1.0-4
147     'insert_above',
148     # our django project
149     'myslice',
150     # the core of the UI
151     'auth', 'manifold', 'unfold',
152     # plugins
153     'plugins',
154     # views - more or less stable 
155     'views',
156     'trash',
157     # Uncomment the next line to enable the admin:
158     # 'django.contrib.admin',
159     # Uncomment the next line to enable admin documentation:
160     # 'django.contrib.admindocs',
161     'portal',
162 # DEPRECATED #    'django.contrib.formtools',
163 # DEPRECATED ##    'crispy_forms',
164 # DEPRECATED #
165 # DEPRECATED #    # User registration
166 # DEPRECATED #    'django.contrib.auth',
167 # DEPRECATED #    'django.contrib.sites',
168 # DEPRECATED #    'registration',
169 )
170
171 ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window; you may, of course, use a different value.
172
173 # A sample logging configuration. The only tangible logging
174 # performed by this configuration is to send an email to
175 # the site admins on every HTTP 500 error when DEBUG=False.
176 # See http://docs.djangoproject.com/en/dev/topics/logging for
177 # more details on how to customize your logging configuration.
178 LOGGING = {
179     'version': 1,
180     'disable_existing_loggers': False,
181     'filters': {
182         'require_debug_false': {
183             '()': 'django.utils.log.RequireDebugFalse'
184         }
185     },
186     'handlers': {
187         'mail_admins': {
188             'level': 'ERROR',
189             'filters': ['require_debug_false'],
190             'class': 'django.utils.log.AdminEmailHandler',
191         }
192     },
193     'loggers': {
194         'django.request': {
195             'handlers': ['mail_admins'],
196             'level': 'ERROR',
197             'propagate': True,
198         },
199     }
200 }
201
202 AUTHENTICATION_BACKENDS = ( 'auth.backend.MyCustomBackend', 'auth.manifoldbackend.ManifoldBackend', )
203
204 ### the view to redirect malformed (i.e. with a wrong CSRF) incoming requests
205 # without this setting django will return a 403 forbidden error, which is fine
206 # if you need to see the error message then use this setting
207 CSRF_FAILURE_VIEW = 'manifold.manifoldproxy.csrf_failure'
208
209 #################### for insert_above
210 #IA_JS_FORMAT = "<script type='text/javascript' src='{URL}' />"
211 # put stuff under static/
212 # IA_MEDIA_PREFIX = '/code/'
213