Statistics
| Branch: | Tag: | Revision:

root / commissioning / servers / django_server / settings.py @ 9c50a5ac

History | View | Annotate | Download (3.6 kB)

1
# Django settings for quota project.
2

    
3
DEBUG = True
4
TEMPLATE_DEBUG = DEBUG
5

    
6
try:
7
    _appname = COMMISSIONING_APP_NAME
8
except NameError:
9
    from os import environ
10
    if 'COMMISSIONING_APP_NAME' not in environ:
11
        m = ("Cannot determine COMMISSIONING_APP_NAME from "
12
             "settings.py or getenv()")
13
        raise ValueError(m)
14

    
15
    _appname = environ['COMMISSIONING_APP_NAME']
16

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

    
21
MANAGERS = ADMINS
22

    
23
DATABASES = {
24
    'default': {
25
        # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
26
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
27
        'NAME': 'holder',                       # Or path to database file if using sqlite3.
28
        'USER': 'holder',                       # Not used with sqlite3.
29
        'PASSWORD': 'holder',                   # Not used with sqlite3.
30
        'HOST': 'dev84.dev.grnet.gr',           # Set to empty string for localhost. Not used with sqlite3.
31
        'PORT': '5432',                         # Set to empty string for default. Not used with sqlite3.
32
    }
33
}
34

    
35
ROOT_URLCONF = 'commissioning.servers.django_server.urls'
36

    
37
from commissioning.utils.pyconf import pyconf_vars
38
conffile = '/etc/%s/django.conf' % (_appname,)
39
pyconf_vars(conffile, locals())
40
COMMISSIONING_APP_NAME=_appname
41
del _appname
42

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

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

    
56
SITE_ID = 1
57

    
58
# If you set this to False, Django will make some optimizations so as not
59
# to load the internationalization machinery.
60
USE_I18N = False
61

    
62
# If you set this to False, Django will not format dates, numbers and
63
# calendars according to the current locale
64
USE_L10N = False
65

    
66
# Make this unique, and don't share it with anybody.
67
SECRET_KEY = 'ee=*x%x6sp=hcm7j4zzkvpam27g*7*d59fca-q!azaqma!jx*+'
68

    
69
# List of callables that know how to import templates from various sources.
70
TEMPLATE_LOADERS = (
71
    'django.template.loaders.filesystem.Loader',
72
    'django.template.loaders.app_directories.Loader',
73
#     'django.template.loaders.eggs.Loader',
74
)
75

    
76
MIDDLEWARE_CLASSES = (
77
    'django.middleware.common.CommonMiddleware',
78
    #'django.middleware.transaction.TransactionMiddleware',
79
    #'django.contrib.sessions.middleware.SessionMiddleware',
80
    #'django.middleware.csrf.CsrfViewMiddleware',
81
    #'django.contrib.auth.middleware.AuthenticationMiddleware',
82
    #'django.contrib.messages.middleware.MessageMiddleware',
83
)
84

    
85
TEMPLATE_DIRS = (
86
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
87
    # Always use forward slashes, even on Windows.
88
    # Don't forget to use absolute paths, not relative paths.
89
)
90

    
91
INSTALLED_APPS = (
92
    'django.contrib.contenttypes',
93
    'commissioning.controllers.django_controller',
94
    'commissioning.servers.django_server.server_app',
95
    #'django_extensions',
96
)
97

    
98
names = COMMISSIONING_APP_NAME.split(',')
99
names = ('commissioning.servers.%s.django_backend' % (n,) for n in names)
100
from django.utils.importlib import import_module
101

    
102
applist = []
103
for name in names:
104
    try:
105
        import_module(name)
106
        applist.append(name)
107
    except ImportError:
108
        pass
109

    
110
INSTALLED_APPS += tuple(applist)
111