1 # Django settings for unfold project.
6 djcelery.setup_loader()
8 ### detect if we're in a build environment
16 TEMPLATE_DEBUG = DEBUG
18 # compute ROOT from where this file is installed
19 # should fit every need including developers
20 # but you can redefine ROOT if that's not working for you
22 # get the directory where this file is
23 ROOT=os.path.dirname(__file__) or '.'
25 ROOT=os.path.realpath(ROOT+'/..')
27 # something is badly wrong here
32 #### this is where the problem lies I believe
33 # first try to run manage.py collectstatic without this
37 from myslice.configengine import ConfigEngine
38 configEngine = ConfigEngine()
39 if configEngine.myslice.theme :
40 theme = configEngine.myslice.theme
44 # find out HTTPROOT, which is different from ROOT
45 # when deployed from a package
46 # this code is run by collectstatic too, so we cannot
47 # assume we have ./static present already
48 HTTPROOT="/var/myslice-f4f"
49 # the place to store local data, like e.g. the sqlite db
50 DATAROOT="/var/unfold"
51 # if not there, then we assume it's from a devel tree
52 if not os.path.isdir (os.path.join(HTTPROOT,"static")):
55 if not os.path.isdir(ROOT): raise Exception,"Cannot find ROOT %s for unfold"%ROOT
56 if not os.path.isdir(HTTPROOT): raise Exception,"Cannot find HTTPROOT %s for unfold"%HTTPROOT
58 # dec 2013 - we currently have 2 auxiliary subdirs with various utilities
59 # that we do not wish to package
60 # * sandbox is for plugin developers
61 # * sample is for various test views
62 # for each of these, if we find a directory of that name under ROOT, it then gets
63 # inserted in INSTALLED_APPS and its urls get included (see urls.py)
64 auxiliaries = [ 'sandbox', 'sample', ]
68 # ('your_name', 'your_email@test.com'),
74 #DEFAULT_FROM_EMAIL = "root@theseus.ipv6.lip6.fr"
75 #EMAIL_HOST_PASSWORD = "mypassword"
77 EMAIL_HOST = "localhost"
81 # use the email for debugging purpose
83 # python -m smtpd -n -c DebuggingServer localhost:1025
86 # EMAIL_HOST = 'localhost'
88 # EMAIL_HOST_USER = ''
89 # EMAIL_HOST_PASSWORD = ''
90 # EMAIL_USE_TLS = False
91 # DEFAULT_FROM_EMAIL = 'testing@example.com'
95 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
96 'NAME': os.path.join(DATAROOT,'unfold.sqlite3'), # Or path to database file if using sqlite3.
97 'USER': '', # Not used with sqlite3.
98 'PASSWORD': '', # Not used with sqlite3.
99 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
100 'PORT': '', # Set to empty string for default. Not used with sqlite3.
104 # Local time zone for this installation. Choices can be found here:
105 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
106 # although not all choices may be available on all operating systems.
107 # In a Windows environment this must be set to your system time zone.
108 TIME_ZONE = 'Europe/Paris'
110 # Language code for this installation. All choices can be found here:
111 # http://www.i18nguy.com/unicode/language-identifiers.html
112 LANGUAGE_CODE = 'en-us'
116 # If you set this to False, Django will make some optimizations so as not
117 # to load the internationalization machinery.
120 # If you set this to False, Django will not format dates, numbers and
121 # calendars according to the current locale.
124 # If you set this to False, Django will not use timezone-aware datetimes.
127 # Absolute filesystem path to the directory that will hold user-uploaded files.
128 # Example: "/home/media/media.lawrence.com/media/"
131 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
133 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
136 # Absolute path to the directory static files should be collected to.
137 # Don't put anything in this directory yourself; store your static files
138 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
139 # Example: "/home/media/media.lawrence.com/static/"
140 STATIC_ROOT = os.path.join(HTTPROOT,'static')
142 # URL prefix for static files.
143 # Example: "http://media.lawrence.com/static/"
144 STATIC_URL = '/static/'
146 # Additional locations of static files
148 # Put strings here, like "/home/html/static" or "C:/www/django/static".
149 # Always use forward slashes, even on Windows.
150 # Don't forget to use absolute paths, not relative paths.
151 # Thierry : we do not need to detail the contents
152 # of our 'apps' since they're mentioned in INSTALLED_APPS
155 # Needed by PluginFinder
156 PLUGIN_DIR = os.path.join(ROOT,'plugins')
158 THIRDPARTY_DIR = os.path.join(ROOT, 'third-party')
160 # List of finder classes that know how to find static files in
162 STATICFILES_FINDERS = (
163 # Thierry : no need for this one
164 # 'django.contrib.staticfiles.finders.FileSystemFinder',
165 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
166 'unfold.collectstatic.PluginFinder',
167 'unfold.collectstatic.ThirdPartyFinder',
168 ### 'django.contrib.staticfiles.finders.DefaultStorageFinder',
171 #TEMPLATE_CONTEXT_PROCESSORS = (
172 # 'django.contrib.auth.context_processors.auth',
173 # 'django.core.context_processors.debug',
174 # 'django.core.context_processors.i18n',
175 # 'django.core.context_processors.media',
176 # 'django.core.context_processors.static',
177 # 'django.core.context_processors.request',
178 # 'django.contrib.messages.context_processors.messages',
181 # Make this unique, and don't share it with anybody.
182 SECRET_KEY = 't%n(3h)&r^n8(+8)(sp29t^$c2#t(m3)e2!02l8w1#36tl#t27'
184 # List of callables that know how to import templates from various sources.
186 'django.template.loaders.filesystem.Loader',
187 'django.template.loaders.app_directories.Loader',
188 # 'django.template.loaders.eggs.Loader',
191 MIDDLEWARE_CLASSES = (
192 'django.middleware.common.CommonMiddleware',
193 'django.contrib.sessions.middleware.SessionMiddleware',
194 'django.middleware.csrf.CsrfViewMiddleware',
195 'django.contrib.auth.middleware.AuthenticationMiddleware',
196 'django.contrib.messages.middleware.MessageMiddleware',
197 # Uncomment the next line for simple clickjacking protection:
198 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
201 ROOT_URLCONF = 'myslice.urls'
203 # Python dotted path to the WSGI application used by Django's runserver.
204 WSGI_APPLICATION = 'unfold.wsgi.application'
207 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
208 # Always use forward slashes, even on Windows.
209 # Don't forget to use absolute paths, not relative paths.
210 if theme is not None:
211 TEMPLATE_DIRS.append ( os.path.join(HTTPROOT,"portal/templates", theme))
212 TEMPLATE_DIRS.append ( os.path.join(HTTPROOT,"portal/templates"))
213 TEMPLATE_DIRS.append ( os.path.join(HTTPROOT,"templates"))
216 'django.contrib.auth',
217 'django.contrib.contenttypes',
218 'django.contrib.sessions',
219 'django.contrib.sites',
220 'django.contrib.messages',
221 'django.contrib.staticfiles',
222 # handling the {% insert %} and {% container %} tags
223 # see details in devel/django-insert-above-1.0-4
233 # views - more or less stable
235 # managing database migrations
237 # Uncomment the next line to enable the admin:
238 'django.contrib.admin',
242 # Uncomment the next line to enable admin documentation:
243 # 'django.contrib.admindocs',
248 # this app won't load in a build environment
249 if not building: INSTALLED_APPS.append ('rest')
251 BROKER_URL = "amqp://myslice:myslice@localhost:5672/myslice"
253 for aux in auxiliaries:
254 if os.path.isdir(os.path.join(ROOT,aux)):
255 print "Using devel auxiliary",aux
256 INSTALLED_APPS.append(aux)
258 ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window; you may, of course, use a different value.
260 # A sample logging configuration. The only tangible logging
261 # performed by this configuration is to send an email to
262 # the site admins on every HTTP 500 error when DEBUG=False.
263 # See http://docs.djangoproject.com/en/dev/topics/logging for
264 # more details on how to customize your logging configuration.
267 'disable_existing_loggers': False,
269 'require_debug_false': {
270 '()': 'django.utils.log.RequireDebugFalse'
276 'filters': ['require_debug_false'],
277 'class': 'django.utils.log.AdminEmailHandler',
282 'handlers': ['mail_admins'],
289 AUTHENTICATION_BACKENDS = ('auth.manifoldbackend.ManifoldBackend',
290 'django.contrib.auth.backends.ModelBackend')
292 ### the view to redirect malformed (i.e. with a wrong CSRF) incoming requests
293 # without this setting django will return a 403 forbidden error, which is fine
294 # if you need to see the error message then use this setting
295 CSRF_FAILURE_VIEW = 'manifoldapi.manifoldproxy.csrf_failure'
297 #################### for insert_above
298 #IA_JS_FORMAT = "<script type='text/javascript' src='{URL}' />"
299 # put stuff under static/
300 # IA_MEDIA_PREFIX = '/code/'
304 SLA_MANAGER_URL = "http://157.193.215.125:4001/sla-collector/sla"
305 #SLA_MANAGER_URL = "http://172.24.76.28:8000/sla"
306 SLA_MANAGER_USER = "portal"
307 SLA_MANAGER_PASSWORD = "password"