Statistics
| Branch: | Tag: | Revision:

root / settings.py.dist @ ac3c3a4b

History | View | Annotate | Download (5.5 kB)

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