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_MIGRATIONS = False
37 # ('Your Name', 'your_email@domain.com'),
42 DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
43 DATABASE_NAME = 'ganeti.db' # Or path to database file if using sqlite3.
44 DATABASE_USER = '' # Not used with sqlite3.
45 DATABASE_PASSWORD = '' # Not used with sqlite3.
46 DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
47 DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
50 # Local time zone for this installation. Choices can be found here:
51 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
52 # although not all choices may be available on all operating systems.
53 # If running in a Windows environment this must be set to the same as your
55 TIME_ZONE = 'America/Los_Angeles'
57 # Language code for this installation. All choices can be found here:
58 # http://www.i18nguy.com/unicode/language-identifiers.html
60 # In order to support localization the following have to be added:
62 ugettext = lambda s: s
64 # If no other locale is present/supported for the time leave the following as is.
65 # When locales are added, place them ath the "('yourlang', ugettext('YOUR LANGUAGE')),"
66 # line. E.g, for the Greek locale, it becomes: ('el', ugettext('Greek'))
69 # ('yourlang', ugettext('YOUR LANGUAGE')),
70 ('el', ugettext('Greek')),
71 ('en', ugettext('English')),
73 # end-of localization support
75 LANGUAGE_CODE = 'en-US'
77 # Unique site id used by many modules to distinguish site from others.
80 # Site name and domain referenced by some modules to provide links back to
82 SITE_NAME = 'Ganeti Web Manager'
83 SITE_DOMAIN = 'localhost:8000'
85 # Enable i18n (translations) and l10n (locales, currency, times).
86 # You really have no good reason to disable this.
90 # absolute path to the docroot of this site
91 DOC_ROOT = os.path.dirname(os.path.realpath(__file__))
93 # prefix used for the site. ie. http://myhost.com/<SITE_ROOT>
94 # for the django standalone server this should be ''
95 # for apache this is the url the site is mapped to, probably /tracker
98 # Absolute path to the directory that holds media.
99 # Example: "/home/media/media.lawrence.com/"
100 MEDIA_ROOT = '%s/media' % DOC_ROOT
102 # URL that handles the media served from MEDIA_ROOT.
103 # XXX contrary to django docs, do not use a trailling slash. It makes urls
104 # using this url easier to read. ie. {{MEDIA_URL}}/images/foo.png
105 MEDIA_URL = '%s/media' % SITE_ROOT
107 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
109 # Examples: "http://foo.com/media/", "/media/".
110 ADMIN_MEDIA_PREFIX = '/adminmedia/'
112 # Make this unique, and don't share it with anybody.
113 SECRET_KEY = '!c&bm88vo=gby*vxf2gydv8hc!+f+eo+yu&!g&!)#n5quwsr82'
115 AUTHENTICATION_BACKENDS = (
116 'django.contrib.auth.backends.ModelBackend',
117 'object_permissions.backend.ObjectPermBackend',
120 # List of callables that know how to import templates from various sources.
122 'django.template.loaders.filesystem.load_template_source',
123 'django.template.loaders.app_directories.load_template_source',
124 # 'django.template.loaders.eggs.load_template_source',
127 TEMPLATE_CONTEXT_PROCESSORS = (
128 'django.contrib.auth.context_processors.auth',
129 'django.contrib.messages.context_processors.messages',
130 'django.core.context_processors.debug',
131 'django.core.context_processors.i18n',
132 'django.core.context_processors.media',
133 'ganeti.context_processors.site',
134 'ganeti.context_processors.common_permissions'
137 MIDDLEWARE_CLASSES = (
138 'django.middleware.common.CommonMiddleware',
139 'django.middleware.csrf.CsrfViewMiddleware',
140 'django.contrib.sessions.middleware.SessionMiddleware',
141 'django.middleware.locale.LocaleMiddleware',
142 'django.contrib.auth.middleware.AuthenticationMiddleware',
143 'django.contrib.messages.middleware.MessageMiddleware',
144 'django.middleware.csrf.CsrfResponseMiddleware'
147 ROOT_URLCONF = 'urls'
150 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
151 # Always use forward slashes, even on Windows.
156 'django.contrib.auth',
157 'django.contrib.contenttypes',
158 'django.contrib.messages',
159 'django.contrib.sessions',
160 'django.contrib.sites',
162 'object_permissions',
170 #haystack search stuff
171 ROOT_DIR_PATH = os.path.dirname(__file__)
172 ROOT_DIR_NAME = ROOT_DIR_PATH.split('/')[-1]
173 HAYSTACK_SITECONF = ROOT_DIR_NAME + '.search_sites'
174 HAYSTACK_SEARCH_ENGINE = 'whoosh'
175 HAYSTACK_WHOOSH_PATH = os.path.join(ROOT_DIR_PATH, 'whoosh_index')
177 AUTH_PROFILE_MODULE = 'ganeti.Profile'
178 LOGIN_REDIRECT_URL = '/'
180 DATE_FORMAT = "d/m/Y H:i"
181 DATETIME_FORMAT = "d/m/Y H:i"
183 ACCOUNT_ACTIVATION_DAYS = 7
185 # Email settings for registration
186 EMAIL_HOST = "localhost"
188 # DEFAULT_FROM_EMAIL = "noreply@example.org"
190 # default items per page
193 # Ganeti Cached Cluster Objects Timeouts
194 # lazy cache is the fallback cache timer that is checked when the object is
197 # periodic cache timer is for use by an outside process such as Celery or
198 # or cron which updates the cache on a set interval to ensure that data is
200 LAZY_CACHE_REFRESH = 60000
201 PERIODIC_CACHE_REFRESH = 15
203 # Enable the VNC proxy. When enabled this will use the proxy to create local
204 # ports that are forwarded to the virtual machines. It allows you to control
205 # access to the VNC servers. When disabled, the console tab will connect
206 # directly to the VNC server running on the virtual machine.
208 # Expected values: False if no proxy, string with proxy host and port otherwise
209 # String syntax: "HOST:PORT", for example: "localhost:8888". Instead of
210 # "localhost" you should use the hostname of your proxy server.
212 # Note: you will probably have to open more ports in firewall. For proxy's default
213 # settings, it uses port 8888 for listening for requests and ports 7000..8000
216 VNC_PROXY='localhost:8888'
219 # API Key for authenticating scripts that pull information from ganeti, such as
220 # list of sshkey's to assign to a virtual machine
222 # XXX this is a temporary feature that will eventually be replaced by a system
223 # that automatically creates keys per virtual machine. This is just a quick
224 # way of enabled a secure method to pull sshkeys from ganeti web manager
225 WEB_MGR_API_KEY = "CHANGE_ME"