root / settings.py.dist @ 8f377cd6
History | View | Annotate | Download (5.5 kB)
1 |
# -*- coding: utf-8 -*- |
---|---|
2 |
|
3 |
# Django settings for synnefo project. |
4 |
import os |
5 |
|
6 |
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/' |
7 |
|
8 |
DEBUG = True |
9 |
TEMPLATE_DEBUG = DEBUG |
10 |
|
11 |
ADMINS = ( |
12 |
# ('Your Name', 'your_email@domain.com'), |
13 |
) |
14 |
|
15 |
MANAGERS = ADMINS |
16 |
|
17 |
DATABASES = { |
18 |
'default': { |
19 |
# 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle' |
20 |
'ENGINE': 'sqlite3', |
21 |
# ATTENTION: This *must* be the absolute path if using sqlite3. |
22 |
# See: http://docs.djangoproject.com/en/dev/ref/settings/#name |
23 |
'NAME': PROJECT_PATH + 'database.sqlite', |
24 |
'USER': '', # Not used with sqlite3. |
25 |
'PASSWORD': '', # Not used with sqlite3. |
26 |
# Set to empty string for localhost. Not used with sqlite3. |
27 |
'HOST': '', |
28 |
# Set to empty string for default. Not used with sqlite3. |
29 |
'PORT': '', |
30 |
} |
31 |
} |
32 |
|
33 |
if DATABASES['default']['ENGINE'].endswith('mysql'): |
34 |
DATABASES['default']['OPTIONS'] = { |
35 |
'init_command': 'SET storage_engine=INNODB', |
36 |
} |
37 |
|
38 |
SESSION_ENGINE = "django.contrib.sessions.backends.cache" |
39 |
|
40 |
# Local time zone for this installation. Choices can be found here: |
41 |
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
42 |
# although not all choices may be available on all operating systems. |
43 |
# On Unix systems, a value of None will cause Django to use the same |
44 |
# timezone as the operating system. |
45 |
# If running in a Windows environment this must be set to the same as your |
46 |
# system time zone. |
47 |
TIME_ZONE = 'UTC' # Warning: API depends on the TIME_ZONE being UTC |
48 |
|
49 |
# Language code for this installation. All choices can be found here: |
50 |
# http://www.i18nguy.com/unicode/language-identifiers.html |
51 |
LANGUAGE_CODE = 'en-us' |
52 |
|
53 |
SITE_ID = 1 |
54 |
|
55 |
# If you set this to False, Django will make some optimizations so as not |
56 |
# to load the internationalization machinery. |
57 |
USE_I18N = True |
58 |
|
59 |
# If you set this to False, Django will not format dates, numbers and |
60 |
# calendars according to the current locale |
61 |
USE_L10N = True |
62 |
|
63 |
# Absolute path to the directory that holds media. |
64 |
# Example: "/home/media/media.lawrence.com/" |
65 |
MEDIA_ROOT = '' |
66 |
|
67 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
68 |
# trailing slash if there is a path component (optional in other cases). |
69 |
# Examples: "http://media.lawrence.com", "http://example.com/media/" |
70 |
MEDIA_URL = '' |
71 |
|
72 |
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
73 |
# trailing slash. |
74 |
# Examples: "http://foo.com/media/", "/media/". |
75 |
ADMIN_MEDIA_PREFIX = '/media/' |
76 |
|
77 |
# our REST API would prefer to be explicit about trailing slashes |
78 |
APPEND_SLASH = False |
79 |
|
80 |
# Make this unique, and don't share it with anybody. |
81 |
SECRET_KEY = 'ly6)mw6a7x%n)-e#zzk4jo6f2=uqu!1o%)2-(7lo+f9yd^k^bg' |
82 |
|
83 |
# List of callables that know how to import templates from various sources. |
84 |
TEMPLATE_LOADERS = ( |
85 |
'django.template.loaders.filesystem.Loader', |
86 |
'django.template.loaders.app_directories.Loader', |
87 |
# 'django.template.loaders.eggs.Loader', |
88 |
) |
89 |
|
90 |
TEMPLATE_CONTEXT_PROCESSORS = ( |
91 |
'django.core.context_processors.request', |
92 |
'django.core.context_processors.i18n', |
93 |
'django.contrib.auth.context_processors.auth', |
94 |
) |
95 |
|
96 |
MIDDLEWARE_CLASSES = ( |
97 |
'django.contrib.sessions.middleware.SessionMiddleware', |
98 |
'synnefo.aai.middleware.SynnefoAuthMiddleware', |
99 |
'django.middleware.locale.LocaleMiddleware', |
100 |
'django.middleware.common.CommonMiddleware', |
101 |
'django.contrib.messages.middleware.MessageMiddleware' |
102 |
) |
103 |
|
104 |
ROOT_URLCONF = 'synnefo.urls' |
105 |
|
106 |
TEMPLATE_DIRS = ( |
107 |
# Put strings here, like "/home/html/django_templates" |
108 |
# or "C:/www/django/templates". |
109 |
# Always use forward slashes, even on Windows. |
110 |
# Don't forget to use absolute paths, not relative paths. |
111 |
) |
112 |
|
113 |
INSTALLED_APPS = ( |
114 |
'django.contrib.auth', |
115 |
'django.contrib.contenttypes', |
116 |
'django.contrib.sessions', |
117 |
'django.contrib.sites', |
118 |
'django.contrib.messages', |
119 |
'django.contrib.admin', |
120 |
# 'django.contrib.admindocs', |
121 |
'synnefo.aai', |
122 |
'synnefo.api', |
123 |
'synnefo.ui', |
124 |
'synnefo.db', |
125 |
'synnefo.ganeti', |
126 |
'synnefo.logic', |
127 |
) |
128 |
|
129 |
# The RAPI endpoint and associated credentials to use |
130 |
# for talking to the Ganeti backend. |
131 |
GANETI_CLUSTER_INFO = ("62.217.120.78", 5080, "synnefo", "ocean!") |
132 |
|
133 |
# This prefix gets used when determining the instance names |
134 |
# of Synnefo VMs at the Ganeti backend. |
135 |
BACKEND_PREFIX_ID = "snf-" |
136 |
|
137 |
LANGUAGES = ( |
138 |
('el', u'Ελληνικά'), |
139 |
('en', 'English'), |
140 |
) |
141 |
|
142 |
# needed for django. this is the class that implements the User system. |
143 |
# We use this to allow users to add stuff for themselves (about, image etc) |
144 |
#http://docs.djangoproject.com/en/dev/topics/auth/#auth-profiles |
145 |
AUTH_PROFILE_MODULE = 'synnefo.OceanUser' |
146 |
|
147 |
# API requests from the GUI time out after that many seconds. |
148 |
TIMEOUT = 10 * 1000 |
149 |
|
150 |
# The API will return HTTP Bad Request if the ?changes-since |
151 |
# parameter refers to a point in time more than POLL_LIMIT seconds ago. |
152 |
POLL_LIMIT = 3600 |
153 |
|
154 |
# This should be set to the PUB endpoint maintained by ganeti-0mqd. |
155 |
# Normally, this is a TCP port on the Ganeti master IP. |
156 |
GANETI_ZMQ_PUBLISHER = "tcp://62.217.120.67:5801" |
157 |
|
158 |
# The API implementation needs to accept and return absolute references |
159 |
# to its resources. Thus, it needs to know its public URL. |
160 |
API_ROOT_URL = 'http://127.0.0.1:8000/api/' |
161 |
|
162 |
SHIBBOLETH_HOST = "http://wayf.grnet.gr/" |
163 |
|
164 |
SHIBBOLETH_WHITELIST = { |
165 |
'localhost' : '127.0.0.1', |
166 |
'testserver' : '127.0.0.1' |
167 |
} |
168 |
|
169 |
#Number of hours during which a user token is active |
170 |
AUTH_TOKEN_DURATION = 24 |
171 |
|
172 |
#Controls whether the system is running tests |
173 |
#Set as reading the DEBUG variable is not reliable (Django changes its value |
174 |
# unpredictably) |
175 |
TESTING = True |