1 # Django settings for ganeti_webmgr project.
8 # XXX - Django sets DEBUG to False when running unittests. They want to ensure
9 # that you test as if it were a production environment. Unfortunately we have
10 # some models and other settings used only for testing. We use the TESTING flag
11 # to enable or disable these items.
13 # If you run the unittests without this set to TRUE, you will get many errors!
17 # ('Your Name', 'your_email@domain.com'),
22 DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
23 DATABASE_NAME = 'ganeti.db' # Or path to database file if using sqlite3.
24 DATABASE_USER = '' # Not used with sqlite3.
25 DATABASE_PASSWORD = '' # Not used with sqlite3.
26 DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
27 DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
30 # Local time zone for this installation. Choices can be found here:
31 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
32 # although not all choices may be available on all operating systems.
33 # If running in a Windows environment this must be set to the same as your
35 TIME_ZONE = 'America/Los_Angeles'
37 # Language code for this installation. All choices can be found here:
38 # http://www.i18nguy.com/unicode/language-identifiers.html
40 # In order to support localization the following have to be added:
42 ugettext = lambda s: s
44 # If no other locale is present/supported for the time leave the following as is.
45 # When locales are added, place them ath the "('yourlang', ugettext('YOUR LANGUAGE')),"
46 # line. E.g, for the Greek locale, it becomes: ('el', ugettext('Greek'))
49 # ('yourlang', ugettext('YOUR LANGUAGE')),
50 ('en', ugettext('English')),
52 # end-of localization support
54 LANGUAGE_CODE = 'en-US'
56 # Unique site id used by many modules to distinguish site from others.
59 # Site name and domain referenced by some modules to provide links back to
61 SITE_NAME = 'Ganeti Web Manager'
62 SITE_DOMAIN = 'localhost:8000'
64 # If you set this to False, Django will make some optimizations so as not
65 # to load the internationalization machinery.
68 # absolute path to the docroot of this site
69 DOC_ROOT = os.path.dirname(os.path.realpath(__file__))
71 # prefix used for the site. ie. http://myhost.com/<SITE_ROOT>
72 # for the django standalone server this should be ''
73 # for apache this is the url the site is mapped to, probably /tracker
76 # Absolute path to the directory that holds media.
77 # Example: "/home/media/media.lawrence.com/"
78 MEDIA_ROOT = '%s/media' % DOC_ROOT
80 # URL that handles the media served from MEDIA_ROOT.
81 # XXX contrary to django docs, do not use a trailling slash. It makes urls
82 # using this url easier to read. ie. {{MEDIA_URL}}/images/foo.png
83 MEDIA_URL = '%s/media' % SITE_ROOT
85 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
87 # Examples: "http://foo.com/media/", "/media/".
88 ADMIN_MEDIA_PREFIX = '/adminmedia/'
90 # Make this unique, and don't share it with anybody.
91 SECRET_KEY = '!c&bm88vo=gby*vxf2gydv8hc!+f+eo+yu&!g&!)#n5quwsr82'
93 AUTHENTICATION_BACKENDS = (
94 'django.contrib.auth.backends.ModelBackend',
95 'object_permissions.backend.ObjectPermBackend',
98 # List of callables that know how to import templates from various sources.
100 'django.template.loaders.filesystem.load_template_source',
101 'django.template.loaders.app_directories.load_template_source',
102 # 'django.template.loaders.eggs.load_template_source',
105 TEMPLATE_CONTEXT_PROCESSORS = (
106 'django.contrib.auth.context_processors.auth',
107 'django.core.context_processors.debug',
108 'django.core.context_processors.i18n',
109 'django.core.context_processors.media',
110 'ganeti.context_processors.site',
111 'ganeti.context_processors.common_permissions'
114 MIDDLEWARE_CLASSES = (
115 'django.middleware.common.CommonMiddleware',
116 'django.middleware.csrf.CsrfViewMiddleware',
117 'django.contrib.sessions.middleware.SessionMiddleware',
118 'django.middleware.locale.LocaleMiddleware',
119 'django.contrib.auth.middleware.AuthenticationMiddleware',
120 'django.contrib.messages.middleware.MessageMiddleware',
121 'django.middleware.csrf.CsrfResponseMiddleware'
124 ROOT_URLCONF = 'urls'
127 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
128 # Always use forward slashes, even on Windows.
133 'django.contrib.auth',
134 'django.contrib.contenttypes',
135 'django.contrib.messages',
136 'django.contrib.sessions',
137 'django.contrib.sites',
139 'object_permissions',
145 AUTH_PROFILE_MODULE = 'ganeti.Profile'
146 LOGIN_REDIRECT_URL = '/'
148 DATE_FORMAT = "d/m/Y H:i"
149 DATETIME_FORMAT = "d/m/Y H:i"
151 ACCOUNT_ACTIVATION_DAYS = 7
153 # Email settings for registration
154 EMAIL_HOST = "localhost"
156 # DEFAULT_FROM_EMAIL = "noreply@example.org"
158 # default items per page
161 # Ganeti Cached Cluster Objects Timeouts
162 # lazy cache is the fallback cache timer that is checked when the object is
165 # periodic cache timer is for use by an outside process such as Celery or
166 # or cron which updates the cache on a set interval to ensure that data is
168 LAZY_CACHE_REFRESH = 60000
169 PERIODIC_CACHE_REFRESH = 15
171 # Enable the VNC proxy. When enabled this will use the proxy to create local
172 # ports that are forwarded to the virtual machines. It allows you to control
173 # access to the VNC servers. When disabled, the console tab will connect
174 # directly to the VNC server running on the virtual machine.
176 # Expected values: False if no proxy, string with proxy host and port otherwise
177 # String syntax: "HOST:PORT", for example: "localhost:8888". Instead of
178 # "localhost" you should use the hostname of your proxy server.
180 # Note: you will probably have to open more ports in firewall. For proxy's default
181 # settings, it uses port 8888 for listening for requests and ports 7000..8000
184 VNC_PROXY='localhost:8888'
187 # API Key for authenticating scripts that pull information from ganeti, such as
188 # list of sshkey's to assign to a virtual machine
190 # XXX this is a temporary feature that will eventually be replaced by a system
191 # that automatically creates keys per virtual machine. This is just a quick
192 # way of enabled a secure method to pull sshkeys from ganeti web manager
193 WEB_MGR_API_KEY = "CHANGE_ME"