Statistics
| Branch: | Tag: | Revision:

root / commissioning / servers / fscrud / settings.py @ 9f1a1bd0

History | View | Annotate | Download (4.3 kB)

1
# Django settings for quota project.
2

    
3
DEBUG = True
4
TEMPLATE_DEBUG = DEBUG
5

    
6
COMMISSIONING_APP_NAME = None
7

    
8
if not COMMISSIONING_APP_NAME:
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
    COMMISSIONING_APP_NAME = environ['COMMISSIONING_APP_NAME']
16

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

    
21
MANAGERS = ADMINS
22

    
23
from commissioning.utils.pvdata import getpv
24

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

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

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

    
50
SITE_ID = 1
51

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

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

    
60
# Absolute path to the directory that holds media.
61
# Example: "/home/media/media.lawrence.com/"
62
MEDIA_ROOT = ''
63

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

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

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

    
77
# List of callables that know how to import templates from various sources.
78
TEMPLATE_LOADERS = (
79
    'django.template.loaders.filesystem.Loader',
80
    'django.template.loaders.app_directories.Loader',
81
#     'django.template.loaders.eggs.Loader',
82
)
83

    
84
MIDDLEWARE_CLASSES = (
85
    'django.middleware.common.CommonMiddleware',
86
    #'django.middleware.transaction.TransactionMiddleware',
87
    #'django.contrib.sessions.middleware.SessionMiddleware',
88
    #'django.middleware.csrf.CsrfViewMiddleware',
89
    #'django.contrib.auth.middleware.AuthenticationMiddleware',
90
    #'django.contrib.messages.middleware.MessageMiddleware',
91
)
92

    
93
ROOT_URLCONF = 'commissioning.servers.fscrud.urls'
94

    
95
TEMPLATE_DIRS = (
96
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
97
    # Always use forward slashes, even on Windows.
98
    # Don't forget to use absolute paths, not relative paths.
99
)
100

    
101

    
102
INSTALLED_APPS = (
103
    #'django.contrib.auth',
104
    'django.contrib.contenttypes',
105
    #'django.contrib.sessions',
106
    #'django.contrib.sites',
107
    #'django.contrib.messages',
108
    'commissioning.controllers.django_controller',
109
    'commissioning.servers.fscrud.server_app',
110
    #'commissioning.servers.django_server.server_app',
111
    # Uncomment the next line to enable the admin:
112
    # 'django.contrib.admin',
113
    # Uncomment the next line to enable admin documentation:
114
    # 'django.contrib.admindocs',
115
)
116

    
117
names = COMMISSIONING_APP_NAME.split(',')
118
names = ('commissioning.servers.%s.django_backend' % (n,) for n in names)
119
from django.utils.importlib import import_module
120

    
121
applist = []
122
for name in names:
123
    try:
124
        import_module(name)
125
        applist.append(name)
126
    except ImportError:
127
        pass
128

    
129
INSTALLED_APPS += tuple(applist)
130