Statistics
| Branch: | Tag: | Revision:

root / settings.py.dist @ b216cb77

History | View | Annotate | Download (5.2 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
ADMINS = (
12
    # ('Your Name', 'your_email@domain.com'),
13
)
14

    
15
MANAGERS = ADMINS
16

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

    
33
if DATABASES['default']['ENGINE'].endswith('mysql'):
34
    DATABASES['default']['OPTIONS'] = {
35
        'init_command': 'SET storage_engine=INNODB',
36
    }
37

    
38
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
39

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

    
49
# Language code for this installation. All choices can be found here:
50
# http://www.i18nguy.com/unicode/language-identifiers.html
51
LANGUAGE_CODE = 'en-us'
52

    
53
SITE_ID = 1
54

    
55
# If you set this to False, Django will make some optimizations so as not
56
# to load the internationalization machinery.
57
USE_I18N = True
58

    
59
# If you set this to False, Django will not format dates, numbers and
60
# calendars according to the current locale
61
USE_L10N = True
62

    
63
# Absolute path to the directory that holds media.
64
# Example: "/home/media/media.lawrence.com/"
65
MEDIA_ROOT = ''
66

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

    
72
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
73
# trailing slash.
74
# Examples: "http://foo.com/media/", "/media/".
75
ADMIN_MEDIA_PREFIX = '/media/'
76

    
77
# our REST API would prefer to be explicit about trailing slashes
78
APPEND_SLASH = False
79

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

    
83
# List of callables that know how to import templates from various sources.
84
TEMPLATE_LOADERS = (
85
    'django.template.loaders.filesystem.Loader',
86
    'django.template.loaders.app_directories.Loader',
87
#     'django.template.loaders.eggs.Loader',
88
)
89

    
90
TEMPLATE_CONTEXT_PROCESSORS = (
91
    'django.core.context_processors.request',
92
    'django.core.context_processors.i18n',
93
    'django.contrib.auth.context_processors.auth',
94
)
95

    
96
MIDDLEWARE_CLASSES = (
97
    'django.contrib.sessions.middleware.SessionMiddleware',
98
    'django.middleware.locale.LocaleMiddleware',
99
    'django.middleware.common.CommonMiddleware',
100
    'synnefo.middleware.StripURLMiddleware',
101
    'django.contrib.auth.middleware.AuthenticationMiddleware',
102
    'django.contrib.messages.middleware.MessageMiddleware',
103
)
104

    
105
ROOT_URLCONF = 'synnefo.urls'
106

    
107
TEMPLATE_DIRS = (
108
    # Put strings here, like "/home/html/django_templates"
109
    # or "C:/www/django/templates".
110
    # Always use forward slashes, even on Windows.
111
    # Don't forget to use absolute paths, not relative paths.
112
)
113

    
114
INSTALLED_APPS = (
115
    'django.contrib.auth',
116
    'django.contrib.contenttypes',
117
    'django.contrib.sessions',
118
    'django.contrib.sites',
119
    'django.contrib.messages',
120
    'django.contrib.admin',
121
    # 'django.contrib.admindocs',
122
    'synnefo.auth',
123
    'synnefo.api',
124
    'synnefo.ui',
125
    'synnefo.db',
126
    'synnefo.ganeti',
127
    'synnefo.logic',
128
)
129

    
130
# The RAPI endpoint and associated credentials to use
131
# for talking to the Ganeti backend.
132
GANETI_CLUSTER_INFO = ("62.217.120.78", 5080, "synnefo", "ocean!")
133

    
134
# This prefix gets used when determining the instance names
135
# of Synnefo VMs at the Ganeti backend.
136
BACKEND_PREFIX_ID = "snf-"
137

    
138
LANGUAGES = (
139
  ('el', u'Ελληνικά'),
140
  ('en', 'English'),
141
)
142

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

    
148
# API requests from the GUI time out after that many seconds.
149
TIMEOUT = 10 * 1000
150

    
151
# The API will return HTTP Bad Request if the ?changes-since
152
# parameter refers to a point in time more than POLL_LIMIT seconds ago.
153
POLL_LIMIT = 3600
154

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

    
159
# The API implementation needs to accept and return absolute references
160
# to its resources. Thus, it needs to know its public URL.
161
API_ROOT_URL = 'http://127.0.0.1:8000/api/'
162