Statistics
| Branch: | Tag: | Revision:

root / settings.py.dist @ ea2bea47

History | View | Annotate | Download (5.6 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
TEST = False
14
if len(sys.argv) >= 2:
15
    if os.path.basename(sys.argv[0]) == 'manage.py' and \
16
        (sys.argv[1] == 'test' or sys.argv[1] == 'hudson'):
17
            TEST = True
18

    
19
ADMINS = (
20
    # ('Your Name', 'your_email@domain.com'),
21
)
22

    
23
MANAGERS = ADMINS
24

    
25
DATABASES = {
26
    'default': {
27
        # 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle'
28
        'ENGINE': 'sqlite3',
29
         # ATTENTION: This *must* be the absolute path if using sqlite3.
30
         # See: http://docs.djangoproject.com/en/dev/ref/settings/#name
31
        'NAME': PROJECT_PATH + 'database.sqlite',
32
        'USER': '',                      # Not used with sqlite3.
33
        'PASSWORD': '',                  # Not used with sqlite3.
34
        # Set to empty string for localhost. Not used with sqlite3.
35
        'HOST': '',
36
        # Set to empty string for default. Not used with sqlite3.
37
        'PORT': '',
38
    }
39
}
40

    
41
if DATABASES['default']['ENGINE'].endswith('mysql'):
42
    DATABASES['default']['OPTIONS'] = {
43
        'init_command': 'SET storage_engine=INNODB',
44
    }
45

    
46
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
47

    
48
# Local time zone for this installation. Choices can be found here:
49
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
50
# although not all choices may be available on all operating systems.
51
# On Unix systems, a value of None will cause Django to use the same
52
# timezone as the operating system.
53
# If running in a Windows environment this must be set to the same as your
54
# system time zone.
55
TIME_ZONE = 'UTC'   # Warning: API depends on the TIME_ZONE being UTC
56

    
57
# Language code for this installation. All choices can be found here:
58
# http://www.i18nguy.com/unicode/language-identifiers.html
59
LANGUAGE_CODE = 'en-us'
60

    
61
SITE_ID = 1
62

    
63
# If you set this to False, Django will make some optimizations so as not
64
# to load the internationalization machinery.
65
USE_I18N = True
66

    
67
# If you set this to False, Django will not format dates, numbers and
68
# calendars according to the current locale
69
USE_L10N = True
70

    
71
# Absolute path to the directory that holds media.
72
# Example: "/home/media/media.lawrence.com/"
73
MEDIA_ROOT = ''
74

    
75
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
76
# trailing slash if there is a path component (optional in other cases).
77
# Examples: "http://media.lawrence.com", "http://example.com/media/"
78
MEDIA_URL = ''
79

    
80
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
81
# trailing slash.
82
# Examples: "http://foo.com/media/", "/media/".
83
ADMIN_MEDIA_PREFIX = '/media/'
84

    
85
# our REST API would prefer to be explicit about trailing slashes
86
APPEND_SLASH = False
87

    
88
# Make this unique, and don't share it with anybody.
89
SECRET_KEY = 'ly6)mw6a7x%n)-e#zzk4jo6f2=uqu!1o%)2-(7lo+f9yd^k^bg'
90

    
91
# List of callables that know how to import templates from various sources.
92
TEMPLATE_LOADERS = (
93
    'django.template.loaders.filesystem.Loader',
94
    'django.template.loaders.app_directories.Loader',
95
#     'django.template.loaders.eggs.Loader',
96
)
97

    
98
TEMPLATE_CONTEXT_PROCESSORS = (
99
    'django.core.context_processors.request',
100
    'django.core.context_processors.i18n',
101
    'django.contrib.auth.context_processors.auth',
102
)
103

    
104
MIDDLEWARE_CLASSES = (
105
    'django.contrib.sessions.middleware.SessionMiddleware',
106
    'synnefo.aai.middleware.SynnefoAuthMiddleware',
107
    'django.middleware.locale.LocaleMiddleware',
108
    'django.middleware.common.CommonMiddleware',
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.aai',
130
    'synnefo.api',
131
    'synnefo.ui',
132
    'synnefo.db',
133
    'synnefo.ganeti',
134
    'synnefo.logic',
135
    'south'
136
)
137

    
138
# The RAPI endpoint and associated credentials to use
139
# for talking to the Ganeti backend.
140
GANETI_CLUSTER_INFO = ("62.217.120.78", 5080, "synnefo", "ocean!")
141

    
142
# This prefix gets used when determining the instance names
143
# of Synnefo VMs at the Ganeti backend.
144
BACKEND_PREFIX_ID = "snf-"
145

    
146
LANGUAGES = (
147
  ('el', u'Ελληνικά'),
148
  ('en', 'English'),
149
)
150

    
151
# needed for django. this is the class that implements the User system.
152
# We use this to allow users to add stuff for themselves (about, image etc)
153
#http://docs.djangoproject.com/en/dev/topics/auth/#auth-profiles
154
AUTH_PROFILE_MODULE = 'synnefo.OceanUser'
155

    
156
# API requests from the GUI time out after that many seconds.
157
TIMEOUT = 10 * 1000
158

    
159
# The API will return HTTP Bad Request if the ?changes-since
160
# parameter refers to a point in time more than POLL_LIMIT seconds ago.
161
POLL_LIMIT = 3600
162

    
163
# This should be set to the PUB endpoint maintained by ganeti-0mqd.
164
# Normally, this is a TCP port on the Ganeti master IP.
165
GANETI_ZMQ_PUBLISHER = "tcp://62.217.120.67:5801"
166

    
167
# The API implementation needs to accept and return absolute references
168
# to its resources. Thus, it needs to know its public URL.
169
API_ROOT_URL = 'http://127.0.0.1:8000/api/'
170

    
171
SHIBBOLETH_HOST = "http://wayf.grnet.gr/"
172

    
173
SHIBBOLETH_WHITELIST = {
174
    'localhost' : '127.0.0.1',
175
    'testserver' : '127.0.0.1'
176
}
177

    
178
#Number of hours during which a user token is active
179
AUTH_TOKEN_DURATION = 24
180