1 #from __future__ import print_function
5 ROOT = os.path.realpath(os.path.dirname(__file__) + '/..')
10 import myslice.components as components
11 from myslice.configengine import ConfigEngine
14 # djcelery.setup_loader()
16 ### detect if we're in a build environment
23 config = ConfigEngine()
25 if config.myslice.debug :
31 if config.myslice.theme :
32 theme = config.myslice.theme
37 if config.myslice.httproot :
38 HTTPROOT = config.myslice.httproot
43 if config.myslice.httproot :
44 DATAROOT = config.myslice.dataroot
49 # dec 2013 - we currently have 2 auxiliary subdirs with various utilities
50 # that we do not wish to package
51 # * sandbox is for plugin developers
52 # * sample is for various test views
53 # for each of these, if we find a directory of that name under ROOT, it then gets
54 # inserted in INSTALLED_APPS and its urls get included (see urls.py)
55 auxiliaries = [ 'sandbox', 'sample', ]
59 # ('your_name', 'your_email@test.com'),
65 #DEFAULT_FROM_EMAIL = "root@theseus.ipv6.lip6.fr"
66 #EMAIL_HOST_PASSWORD = "mypassword"
68 EMAIL_HOST = "localhost"
72 # use the email for debugging purpose
74 # python -m smtpd -n -c DebuggingServer localhost:1025
77 # EMAIL_HOST = 'localhost'
79 # EMAIL_HOST_USER = ''
80 # EMAIL_HOST_PASSWORD = ''
81 # EMAIL_USE_TLS = False
82 # DEFAULT_FROM_EMAIL = 'testing@example.com'
87 'ENGINE' : 'django.db.backends.%s' % config.database.engine,
88 'USER' : config.database.user or '',
89 'PASSWORD' : config.database.password or '',
90 'HOST' : config.database.host or '',
91 'PORT' : config.database.port or '',
94 if config.database.engine == 'sqlite3' :
95 DATABASES['default']['NAME'] = os.path.join(DATAROOT,'%s.sqlite3' % config.database.name)
97 DATABASES['default']['NAME'] = config.database.name
99 # default database is sqlite
102 'ENGINE' : 'django.db.backends.sqlite3',
103 'NAME' : os.path.join(DATAROOT,'myslice.sqlite3'),
111 # Local time zone for this installation. Choices can be found here:
112 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
113 # although not all choices may be available on all operating systems.
114 # In a Windows environment this must be set to your system time zone.
115 TIME_ZONE = 'Europe/Paris'
117 # Language code for this installation. All choices can be found here:
118 # http://www.i18nguy.com/unicode/language-identifiers.html
119 LANGUAGE_CODE = 'en-us'
123 # If you set this to False, Django will make some optimizations so as not
124 # to load the internationalization machinery.
127 # If you set this to False, Django will not format dates, numbers and
128 # calendars according to the current locale.
131 # If you set this to False, Django will not use timezone-aware datetimes.
134 # Absolute filesystem path to the directory that will hold user-uploaded files.
135 # Example: "/home/media/media.lawrence.com/media/"
138 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
140 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
143 # Absolute path to the directory static files should be collected to.
144 # Don't put anything in this directory yourself; store your static files
145 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
146 # Example: "/home/media/media.lawrence.com/static/"
147 STATIC_ROOT = os.path.join(HTTPROOT,'static')
149 # URL prefix for static files.
150 # Example: "http://media.lawrence.com/static/"
151 STATIC_URL = '/static/'
153 # Additional locations of static files
155 # Put strings here, like "/home/html/static" or "C:/www/django/static".
156 # Always use forward slashes, even on Windows.
157 # Don't forget to use absolute paths, not relative paths.
158 # Thierry : we do not need to detail the contents
159 # of our 'apps' since they're mentioned in INSTALLED_APPS
162 # Needed by PluginFinder
163 PLUGIN_DIR = os.path.join(ROOT,'plugins')
165 THIRDPARTY_DIR = os.path.join(ROOT, 'third-party')
167 # List of finder classes that know how to find static files in
169 STATICFILES_FINDERS = (
170 # Thierry : no need for this one
171 # 'django.contrib.staticfiles.finders.FileSystemFinder',
172 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
173 'unfold.collectstatic.PluginFinder',
174 'unfold.collectstatic.ThirdPartyFinder',
175 ### 'django.contrib.staticfiles.finders.DefaultStorageFinder',
178 #TEMPLATE_CONTEXT_PROCESSORS = (
179 # 'django.contrib.auth.context_processors.auth',
180 # 'django.core.context_processors.debug',
181 # 'django.core.context_processors.i18n',
182 # 'django.core.context_processors.media',
183 # 'django.core.context_processors.static',
184 # 'django.core.context_processors.request',
185 # 'django.contrib.messages.context_processors.messages',
188 # Make this unique, and don't share it with anybody.
189 SECRET_KEY = 't%n(3h)&r^n8(+8)(sp29t^$c2#t(m3)e2!02l8w1#36tl#t27'
191 # List of callables that know how to import templates from various sources.
193 'django.template.loaders.filesystem.Loader',
194 'django.template.loaders.app_directories.Loader',
195 # 'django.template.loaders.eggs.Loader',
198 MIDDLEWARE_CLASSES = (
199 'django.middleware.common.CommonMiddleware',
200 'django.contrib.sessions.middleware.SessionMiddleware',
201 'django.middleware.csrf.CsrfViewMiddleware',
202 'django.contrib.auth.middleware.AuthenticationMiddleware',
203 'django.contrib.messages.middleware.MessageMiddleware',
204 # Uncomment the next line for simple clickjacking protection:
205 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
208 ROOT_URLCONF = 'myslice.urls'
210 # Python dotted path to the WSGI application used by Django's runserver.
211 WSGI_APPLICATION = 'unfold.wsgi.application'
214 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
215 # Always use forward slashes, even on Windows.
216 # Don't forget to use absolute paths, not relative paths.
217 if theme is not None:
218 TEMPLATE_DIRS.append( os.path.join(HTTPROOT,"portal/templates", theme) )
219 TEMPLATE_DIRS.append( os.path.join(HTTPROOT,"portal/templates") )
220 TEMPLATE_DIRS.append( os.path.join(HTTPROOT,"templates") )
223 'django.contrib.auth',
224 'django.contrib.contenttypes',
225 'django.contrib.sessions',
226 'django.contrib.sites',
227 'django.contrib.messages',
228 'django.contrib.staticfiles',
229 # handling the {% insert %} and {% container %} tags
230 # see details in devel/django-insert-above-1.0-4
240 # views - more or less stable
242 # managing database migrations
244 # Uncomment the next line to enable the admin:
245 'django.contrib.admin',
248 # Uncomment the next line to enable admin documentation:
249 # 'django.contrib.admindocs',
252 # this app won't load in a build environment
253 if not building: INSTALLED_APPS.append ('rest')
255 for component in components.list() :
256 INSTALLED_APPS.append(component)
258 BROKER_URL = "amqp://myslice:myslice@localhost:5672/myslice"
260 for aux in auxiliaries:
261 if os.path.isdir(os.path.join(ROOT,aux)):
262 print("Using devel auxiliary",aux)
263 INSTALLED_APPS.append(aux)
265 ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window; you may, of course, use a different value.
267 # A sample logging configuration. The only tangible logging
268 # performed by this configuration is to send an email to
269 # the site admins on every HTTP 500 error when DEBUG=False.
270 # See http://docs.djangoproject.com/en/dev/topics/logging for
271 # more details on how to customize your logging configuration.
274 'disable_existing_loggers': False,
276 'require_debug_false': {
277 '()': 'django.utils.log.RequireDebugFalse'
283 'filters': ['require_debug_false'],
284 'class': 'django.utils.log.AdminEmailHandler',
289 'handlers': ['mail_admins'],
296 AUTHENTICATION_BACKENDS = ('auth.manifoldbackend.ManifoldBackend',
297 'django.contrib.auth.backends.ModelBackend')
299 ### the view to redirect malformed (i.e. with a wrong CSRF) incoming requests
300 # without this setting django will return a 403 forbidden error, which is fine
301 # if you need to see the error message then use this setting
302 CSRF_FAILURE_VIEW = 'manifoldapi.manifoldproxy.csrf_failure'
304 #################### for insert_above
305 #IA_JS_FORMAT = "<script type='text/javascript' src='{URL}' />"
306 # put stuff under static/
307 # IA_MEDIA_PREFIX = '/code/'
311 SLA_MANAGER_URL = "http://157.193.215.125:4001/sla-collector/sla"
312 #SLA_MANAGER_URL = "http://172.24.76.28:8000/sla"
313 SLA_MANAGER_USER = "portal"
314 SLA_MANAGER_PASSWORD = "password"