1 # Django settings for unfold project.
5 ### detect if we're in a build environment
13 TEMPLATE_DEBUG = DEBUG
15 # compute ROOT from where this file is installed
16 # should fit every need including developers
17 # but you can redefine ROOT if that's not working for you
19 # get the directory where this file is
20 ROOT=os.path.dirname(__file__) or '.'
22 ROOT=os.path.realpath(ROOT+'/..')
24 # something is badly wrong here
29 #### this is where the problem lies I believe
30 # first try to run manage.py collectstatic without this
34 from myslice.configengine import ConfigEngine
35 configEngine = ConfigEngine()
36 if configEngine.myslice.theme :
37 theme = configEngine.myslice.theme
41 # find out HTTPROOT, which is different from ROOT
42 # when deployed from a package
43 # this code is run by collectstatic too, so we cannot
44 # assume we have ./static present already
45 HTTPROOT="/var/myslice-f4f"
46 # the place to store local data, like e.g. the sqlite db
47 DATAROOT="/var/unfold"
48 # if not there, then we assume it's from a devel tree
49 if not os.path.isdir (os.path.join(HTTPROOT,"static")):
52 if not os.path.isdir(ROOT): raise Exception,"Cannot find ROOT %s for unfold"%ROOT
53 if not os.path.isdir(HTTPROOT): raise Exception,"Cannot find HTTPROOT %s for unfold"%HTTPROOT
55 # dec 2013 - we currently have 2 auxiliary subdirs with various utilities
56 # that we do not wish to package
57 # * sandbox is for plugin developers
58 # * sample is for various test views
59 # for each of these, if we find a directory of that name under ROOT, it then gets
60 # inserted in INSTALLED_APPS and its urls get included (see urls.py)
61 auxiliaries = [ 'sandbox', 'sample', ]
65 # ('your_name', 'your_email@test.com'),
71 #DEFAULT_FROM_EMAIL = "root@theseus.ipv6.lip6.fr"
72 #EMAIL_HOST_PASSWORD = "mypassword"
74 EMAIL_HOST = "localhost"
78 # use the email for debugging purpose
80 # python -m smtpd -n -c DebuggingServer localhost:1025
83 # EMAIL_HOST = 'localhost'
85 # EMAIL_HOST_USER = ''
86 # EMAIL_HOST_PASSWORD = ''
87 # EMAIL_USE_TLS = False
88 # DEFAULT_FROM_EMAIL = 'testing@example.com'
92 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
93 'NAME': os.path.join(DATAROOT,'unfold.sqlite3'), # Or path to database file if using sqlite3.
94 'USER': '', # Not used with sqlite3.
95 'PASSWORD': '', # Not used with sqlite3.
96 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
97 'PORT': '', # Set to empty string for default. Not used with sqlite3.
101 # Local time zone for this installation. Choices can be found here:
102 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
103 # although not all choices may be available on all operating systems.
104 # In a Windows environment this must be set to your system time zone.
105 TIME_ZONE = 'Europe/Paris'
107 # Language code for this installation. All choices can be found here:
108 # http://www.i18nguy.com/unicode/language-identifiers.html
109 LANGUAGE_CODE = 'en-us'
113 # If you set this to False, Django will make some optimizations so as not
114 # to load the internationalization machinery.
117 # If you set this to False, Django will not format dates, numbers and
118 # calendars according to the current locale.
121 # If you set this to False, Django will not use timezone-aware datetimes.
124 # Absolute filesystem path to the directory that will hold user-uploaded files.
125 # Example: "/home/media/media.lawrence.com/media/"
128 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
130 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
133 # Absolute path to the directory static files should be collected to.
134 # Don't put anything in this directory yourself; store your static files
135 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
136 # Example: "/home/media/media.lawrence.com/static/"
137 STATIC_ROOT = os.path.join(HTTPROOT,'static')
139 # URL prefix for static files.
140 # Example: "http://media.lawrence.com/static/"
141 STATIC_URL = '/static/'
143 # Additional locations of static files
145 # Put strings here, like "/home/html/static" or "C:/www/django/static".
146 # Always use forward slashes, even on Windows.
147 # Don't forget to use absolute paths, not relative paths.
148 # Thierry : we do not need to detail the contents
149 # of our 'apps' since they're mentioned in INSTALLED_APPS
152 # Needed by PluginFinder
153 PLUGIN_DIR = os.path.join(ROOT,'plugins')
155 THIRDPARTY_DIR = os.path.join(ROOT, 'third-party')
157 # List of finder classes that know how to find static files in
159 STATICFILES_FINDERS = (
160 # Thierry : no need for this one
161 # 'django.contrib.staticfiles.finders.FileSystemFinder',
162 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
163 'unfold.collectstatic.PluginFinder',
164 'unfold.collectstatic.ThirdPartyFinder',
165 ### 'django.contrib.staticfiles.finders.DefaultStorageFinder',
168 #TEMPLATE_CONTEXT_PROCESSORS = (
169 # 'django.contrib.auth.context_processors.auth',
170 # 'django.core.context_processors.debug',
171 # 'django.core.context_processors.i18n',
172 # 'django.core.context_processors.media',
173 # 'django.core.context_processors.static',
174 # 'django.core.context_processors.request',
175 # 'django.contrib.messages.context_processors.messages',
178 # Make this unique, and don't share it with anybody.
179 SECRET_KEY = 't%n(3h)&r^n8(+8)(sp29t^$c2#t(m3)e2!02l8w1#36tl#t27'
181 # List of callables that know how to import templates from various sources.
183 'django.template.loaders.filesystem.Loader',
184 'django.template.loaders.app_directories.Loader',
185 # 'django.template.loaders.eggs.Loader',
188 MIDDLEWARE_CLASSES = (
189 'django.middleware.common.CommonMiddleware',
190 'django.contrib.sessions.middleware.SessionMiddleware',
191 'django.middleware.csrf.CsrfViewMiddleware',
192 'django.contrib.auth.middleware.AuthenticationMiddleware',
193 'django.contrib.messages.middleware.MessageMiddleware',
194 # Uncomment the next line for simple clickjacking protection:
195 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
198 ROOT_URLCONF = 'myslice.urls'
200 # Python dotted path to the WSGI application used by Django's runserver.
201 WSGI_APPLICATION = 'unfold.wsgi.application'
204 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
205 # Always use forward slashes, even on Windows.
206 # Don't forget to use absolute paths, not relative paths.
207 if theme is not None:
208 TEMPLATE_DIRS.append ( os.path.join(HTTPROOT,"portal/templates", theme))
209 TEMPLATE_DIRS.append ( os.path.join(HTTPROOT,"portal/templates"))
210 TEMPLATE_DIRS.append ( os.path.join(HTTPROOT,"templates"))
213 'django.contrib.auth',
214 'django.contrib.contenttypes',
215 'django.contrib.sessions',
216 'django.contrib.sites',
217 'django.contrib.messages',
218 'django.contrib.staticfiles',
219 # handling the {% insert %} and {% container %} tags
220 # see details in devel/django-insert-above-1.0-4
230 # views - more or less stable
232 # managing database migrations
234 # Uncomment the next line to enable the admin:
235 'django.contrib.admin',
236 # Uncomment the next line to enable admin documentation:
237 # 'django.contrib.admindocs',
242 # this app won't load in a build environment
243 if not building: INSTALLED_APPS.append ('rest')
245 for aux in auxiliaries:
246 if os.path.isdir(os.path.join(ROOT,aux)):
247 print "Using devel auxiliary",aux
248 INSTALLED_APPS.append(aux)
250 ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window; you may, of course, use a different value.
252 # A sample logging configuration. The only tangible logging
253 # performed by this configuration is to send an email to
254 # the site admins on every HTTP 500 error when DEBUG=False.
255 # See http://docs.djangoproject.com/en/dev/topics/logging for
256 # more details on how to customize your logging configuration.
259 'disable_existing_loggers': False,
261 'require_debug_false': {
262 '()': 'django.utils.log.RequireDebugFalse'
268 'filters': ['require_debug_false'],
269 'class': 'django.utils.log.AdminEmailHandler',
274 'handlers': ['mail_admins'],
281 AUTHENTICATION_BACKENDS = ( 'auth.manifoldbackend.ManifoldBackend','django.contrib.auth.backends.ModelBackend' )
283 ### the view to redirect malformed (i.e. with a wrong CSRF) incoming requests
284 # without this setting django will return a 403 forbidden error, which is fine
285 # if you need to see the error message then use this setting
286 CSRF_FAILURE_VIEW = 'manifoldapi.manifoldproxy.csrf_failure'
288 #################### for insert_above
289 #IA_JS_FORMAT = "<script type='text/javascript' src='{URL}' />"
290 # put stuff under static/
291 # IA_MEDIA_PREFIX = '/code/'
295 SLA_MANAGER_URL = "http://157.193.215.125:4000/sla-service"
296 SLA_MANAGER_USER = "normal_user"
297 SLA_MANAGER_PASSWORD = "password"