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