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