1 # Django settings for myslice project.
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
12 # get the directory where this file is
13 ROOT=os.path.dirname(__file__) or '.'
15 ROOT=os.path.realpath(ROOT+'/..')
17 # something is badly wrong here
22 # find out DATAROOT, which is different from ROOT
23 # when deployed from a package
24 # this code is run by collectstatic too, so we cannot
25 # assume we have ./static present already
26 DATAROOT="/usr/share/unfold"
27 # if not there, then we assume it's from a devel tree
28 if not os.path.isdir (os.path.join(DATAROOT,"static")):
31 if not os.path.isdir(ROOT): raise Exception,"Cannot find ROOT %s for myslice"%ROOT
32 if not os.path.isdir(DATAROOT): raise Exception,"Cannot find DATAROOT %s for myslice"%DATAROOT
36 # ('your_name', 'your_email@test.com'),
42 #DEFAULT_FROM_EMAIL = "root@theseus.ipv6.lip6.fr"
43 #EMAIL_HOST_PASSWORD = "mypassword"
45 EMAIL_HOST = "localhost"
51 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
52 'NAME': os.path.join(DATAROOT,'myslice.sqlite3'), # Or path to database file if using sqlite3.
53 'USER': '', # Not used with sqlite3.
54 'PASSWORD': '', # Not used with sqlite3.
55 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
56 'PORT': '', # Set to empty string for default. Not used with sqlite3.
60 # Local time zone for this installation. Choices can be found here:
61 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
62 # although not all choices may be available on all operating systems.
63 # In a Windows environment this must be set to your system time zone.
64 TIME_ZONE = 'America/Chicago'
66 # Language code for this installation. All choices can be found here:
67 # http://www.i18nguy.com/unicode/language-identifiers.html
68 LANGUAGE_CODE = 'en-us'
72 # If you set this to False, Django will make some optimizations so as not
73 # to load the internationalization machinery.
76 # If you set this to False, Django will not format dates, numbers and
77 # calendars according to the current locale.
80 # If you set this to False, Django will not use timezone-aware datetimes.
83 # Absolute filesystem path to the directory that will hold user-uploaded files.
84 # Example: "/home/media/media.lawrence.com/media/"
87 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
89 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
92 # Absolute path to the directory static files should be collected to.
93 # Don't put anything in this directory yourself; store your static files
94 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
95 # Example: "/home/media/media.lawrence.com/static/"
96 STATIC_ROOT = os.path.join(DATAROOT,'static')
98 # URL prefix for static files.
99 # Example: "http://media.lawrence.com/static/"
100 STATIC_URL = '/static/'
102 # Additional locations of static files
104 # Put strings here, like "/home/html/static" or "C:/www/django/static".
105 # Always use forward slashes, even on Windows.
106 # Don't forget to use absolute paths, not relative paths.
107 # Thierry : we do not need to detail the contents
108 # of our 'apps' since they're mentioned in INSTALLED_APPS
111 # Needed by PluginFinder
112 PLUGIN_DIR = os.path.join(ROOT,'plugins')
114 THIRDPARTY_DIR = os.path.join(ROOT, 'third-party')
116 # List of finder classes that know how to find static files in
118 STATICFILES_FINDERS = (
119 # Thierry : no need for this one
120 # 'django.contrib.staticfiles.finders.FileSystemFinder',
121 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
122 'unfold.collectstatic.PluginFinder',
123 'unfold.collectstatic.ThirdPartyFinder',
124 ### 'django.contrib.staticfiles.finders.DefaultStorageFinder',
127 #TEMPLATE_CONTEXT_PROCESSORS = (
128 # 'django.contrib.auth.context_processors.auth',
129 # 'django.core.context_processors.debug',
130 # 'django.core.context_processors.i18n',
131 # 'django.core.context_processors.media',
132 # 'django.core.context_processors.static',
133 # 'django.core.context_processors.request',
134 # 'django.contrib.messages.context_processors.messages',
137 # Make this unique, and don't share it with anybody.
138 SECRET_KEY = 't%n(3h)&r^n8(+8)(sp29t^$c2#t(m3)e2!02l8w1#36tl#t27'
140 # List of callables that know how to import templates from various sources.
142 'django.template.loaders.filesystem.Loader',
143 'django.template.loaders.app_directories.Loader',
144 # 'django.template.loaders.eggs.Loader',
147 MIDDLEWARE_CLASSES = (
148 'django.middleware.common.CommonMiddleware',
149 'django.contrib.sessions.middleware.SessionMiddleware',
150 'django.middleware.csrf.CsrfViewMiddleware',
151 'django.contrib.auth.middleware.AuthenticationMiddleware',
152 'django.contrib.messages.middleware.MessageMiddleware',
153 # Uncomment the next line for simple clickjacking protection:
154 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
157 ROOT_URLCONF = 'myslice.urls'
159 # Python dotted path to the WSGI application used by Django's runserver.
160 WSGI_APPLICATION = 'myslice.wsgi.application'
163 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
164 # Always use forward slashes, even on Windows.
165 # Don't forget to use absolute paths, not relative paths.
166 os.path.join(DATAROOT,"templates"),
170 'django.contrib.auth',
171 'django.contrib.contenttypes',
172 'django.contrib.sessions',
173 'django.contrib.sites',
174 'django.contrib.messages',
175 'django.contrib.staticfiles',
176 # handling the {% insert %} and {% container %} tags
177 # see details in devel/django-insert-above-1.0-4
182 'auth', 'manifold', 'unfold',
185 # views - more or less stable
187 # managing database migrations
189 # Uncomment the next line to enable the admin:
190 # 'django.contrib.admin',
191 # Uncomment the next line to enable admin documentation:
192 # 'django.contrib.admindocs',
194 # temporary - not packaged
197 # DEPRECATED # 'django.contrib.formtools',
198 # DEPRECATED ## 'crispy_forms',
200 # DEPRECATED # # User registration
201 # DEPRECATED # 'django.contrib.auth',
202 # DEPRECATED # 'django.contrib.sites',
203 # DEPRECATED # 'registration',
206 ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window; you may, of course, use a different value.
208 # A sample logging configuration. The only tangible logging
209 # performed by this configuration is to send an email to
210 # the site admins on every HTTP 500 error when DEBUG=False.
211 # See http://docs.djangoproject.com/en/dev/topics/logging for
212 # more details on how to customize your logging configuration.
215 'disable_existing_loggers': False,
217 'require_debug_false': {
218 '()': 'django.utils.log.RequireDebugFalse'
224 'filters': ['require_debug_false'],
225 'class': 'django.utils.log.AdminEmailHandler',
230 'handlers': ['mail_admins'],
237 AUTHENTICATION_BACKENDS = ( 'auth.manifoldbackend.ManifoldBackend', )
239 ### the view to redirect malformed (i.e. with a wrong CSRF) incoming requests
240 # without this setting django will return a 403 forbidden error, which is fine
241 # if you need to see the error message then use this setting
242 CSRF_FAILURE_VIEW = 'manifold.manifoldproxy.csrf_failure'
244 #################### for insert_above
245 #IA_JS_FORMAT = "<script type='text/javascript' src='{URL}' />"
246 # put stuff under static/
247 # IA_MEDIA_PREFIX = '/code/'