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