1 # Copyright (C) 2010 Oregon State University et al.
2 # Copyright (C) 2010 Greek Research and Technology Network
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19 # Django settings for ganeti_webmgr project.
24 TEMPLATE_DEBUG = DEBUG
26 # XXX - Django sets DEBUG to False when running unittests. They want to ensure
27 # that you test as if it were a production environment. Unfortunately we have
28 # some models and other settings used only for testing. We use the TESTING flag
29 # to enable or disable these items.
31 # If you run the unittests without this set to TRUE, you will get many errors!
33 # Setting this to False disables south migrations when running tests.
34 SOUTH_TESTS_MIGRATE = False
35 SKIP_SOUTH_TESTS = True
38 # ('Your Name', 'your_email@domain.com'),
43 DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
44 DATABASE_NAME = 'ganeti.db' # Or path to database file if using sqlite3.
45 DATABASE_USER = '' # Not used with sqlite3.
46 DATABASE_PASSWORD = '' # Not used with sqlite3.
47 DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
48 DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
51 # Local time zone for this installation. Choices can be found here:
52 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
53 # although not all choices may be available on all operating systems.
54 # If running in a Windows environment this must be set to the same as your
56 TIME_ZONE = 'America/Los_Angeles'
58 # Language code for this installation. All choices can be found here:
59 # http://www.i18nguy.com/unicode/language-identifiers.html
61 # In order to support localization the following have to be added:
63 ugettext = lambda s: s
65 # If no other locale is present/supported for the time leave the following as is.
66 # When locales are added, place them ath the "('yourlang', ugettext('YOUR LANGUAGE')),"
67 # line. E.g, for the Greek locale, it becomes: ('el', ugettext('Greek'))
70 # ('yourlang', ugettext('YOUR LANGUAGE')),
71 ('el', ugettext('Greek')),
72 ('en', ugettext('English')),
74 # end-of localization support
76 LANGUAGE_CODE = 'en-US'
78 # Unique site id used by many modules to distinguish site from others.
81 # Site name and domain referenced by some modules to provide links back to
83 SITE_NAME = 'Ganeti Web Manager'
84 SITE_DOMAIN = 'localhost:8000'
86 # Enable i18n (translations) and l10n (locales, currency, times).
87 # You really have no good reason to disable this.
91 # absolute path to the docroot of this site
92 DOC_ROOT = os.path.dirname(os.path.realpath(__file__))
94 # prefix used for the site. ie. http://myhost.com/<SITE_ROOT>
95 # for the django standalone server this should be ''
96 # for apache this is the url the site is mapped to, probably /tracker
99 # Absolute path to the directory that holds media.
100 # Example: "/home/media/media.lawrence.com/"
101 MEDIA_ROOT = '%s/media' % DOC_ROOT
103 # URL that handles the media served from MEDIA_ROOT.
104 # XXX contrary to django docs, do not use a trailling slash. It makes urls
105 # using this url easier to read. ie. {{MEDIA_URL}}/images/foo.png
106 MEDIA_URL = '%s/media' % SITE_ROOT
108 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
110 # Examples: "http://foo.com/media/", "/media/".
111 ADMIN_MEDIA_PREFIX = '/adminmedia/'
113 # Make this unique, and don't share it with anybody.
114 SECRET_KEY = '!c&bm88vo=gby*vxf2gydv8hc!+f+eo+yu&!g&!)#n5quwsr82'
116 AUTHENTICATION_BACKENDS = (
117 'django.contrib.auth.backends.ModelBackend',
118 'object_permissions.backend.ObjectPermBackend',
121 # List of callables that know how to import templates from various sources.
123 'django.template.loaders.filesystem.load_template_source',
124 'django.template.loaders.app_directories.load_template_source',
125 # 'django.template.loaders.eggs.load_template_source',
128 TEMPLATE_CONTEXT_PROCESSORS = (
129 'django.contrib.auth.context_processors.auth',
130 'django.contrib.messages.context_processors.messages',
131 'django.core.context_processors.debug',
132 'django.core.context_processors.i18n',
133 'django.core.context_processors.media',
134 'ganeti_web.context_processors.site',
135 'ganeti_web.context_processors.common_permissions'
138 MIDDLEWARE_CLASSES = (
139 'django.middleware.common.CommonMiddleware',
140 'django.middleware.csrf.CsrfViewMiddleware',
141 'django.contrib.sessions.middleware.SessionMiddleware',
142 'django.middleware.locale.LocaleMiddleware',
143 'django.contrib.auth.middleware.AuthenticationMiddleware',
144 'django.contrib.messages.middleware.MessageMiddleware',
145 'django.middleware.csrf.CsrfResponseMiddleware'
148 ROOT_URLCONF = 'urls'
151 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
152 # Always use forward slashes, even on Windows.
157 'django.contrib.auth',
158 'django.contrib.contenttypes',
159 'django.contrib.messages',
160 'django.contrib.sessions',
161 'django.contrib.sites',
163 'deprecated.ganeti', # XXX deprecated ganeti MUST come before ganeti_web
164 'ganeti_web', # XXX must come before object permissions for migration to 0.7
165 'object_permissions',
173 ROOT_DIR_NAME = DOC_ROOT.split('/')[-1]
174 HAYSTACK_SITECONF = ROOT_DIR_NAME + '.search_sites'
175 HAYSTACK_SEARCH_ENGINE = 'whoosh'
176 HAYSTACK_WHOOSH_PATH = os.path.join(DOC_ROOT, 'whoosh_index')
178 AUTH_PROFILE_MODULE = 'ganeti_web.Profile'
179 LOGIN_REDIRECT_URL = '/'
181 DATE_FORMAT = "d/m/Y H:i"
182 DATETIME_FORMAT = "d/m/Y H:i"
184 ACCOUNT_ACTIVATION_DAYS = 7
186 # Email settings for registration
187 EMAIL_HOST = "localhost"
189 # DEFAULT_FROM_EMAIL = "noreply@example.org"
191 # default items per page
194 # Ganeti Cached Cluster Objects Timeouts
195 # lazy cache is the fallback cache timer that is checked when the object is
198 # periodic cache timer is for use by an outside process such as Celery or
199 # or cron which updates the cache on a set interval to ensure that data is
201 LAZY_CACHE_REFRESH = 60000
202 PERIODIC_CACHE_REFRESH = 15
204 # VNC Proxy. This will use a proxy to create local ports that are forwarded to
205 # the virtual machines. It allows you to control access to the VNC servers.
208 # String syntax: "HOST:CONTROL_PORT", for example: "localhost:8888". If
209 # localhost is used then the proxy will only be accessible to clients and
210 # browsers on localhost. Production servers should use a publicly accessible
214 # Control Port: 8888, must be open between Ganeti Web Manager and Proxy
215 # Internal Ports: 12000+ must be open between the Proxy and Ganeti Nodes
216 # External Ports: default is 7000-8000, must be open between Proxy and Clients
217 # Flash Policy Server: 843, must open between Proxy and Clients
219 VNC_PROXY='localhost:8888'
222 # API Key for authenticating scripts that pull information from ganeti, such as
223 # list of sshkey's to assign to a virtual machine
225 # XXX this is a temporary feature that will eventually be replaced by a system
226 # that automatically creates keys per virtual machine. This is just a quick
227 # way of enabled a secure method to pull sshkeys from ganeti web manager
228 WEB_MGR_API_KEY = "CHANGE_ME"