Statistics
| Branch: | Tag: | Revision:

root / settings.py.dist @ 424e79da

History | View | Annotate | Download (5.8 kB)

1
# Django settings for flowspy project.
2

    
3
import os
4
import djcelery
5
djcelery.setup_loader()
6
from celery.schedules import crontab
7
DEBUG = True
8
TEMPLATE_DEBUG = DEBUG
9

    
10
ADMINS = (
11
    ('AdminName', 'adminmail@admin.com'),
12
)
13

    
14
here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x)
15

    
16

    
17

    
18
MANAGERS = ADMINS
19

    
20
DATABASES = {
21
    'default': {
22
        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
23
        'NAME': '',                      # Or path to database file if using sqlite3.
24
        'USER': '',                      # Not used with sqlite3.
25
        'PASSWORD': '',                  # Not used with sqlite3.
26
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
27
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
28
        'OPTIONS':  {
29
        "init_command": "SET storage_engine=INNODB",
30
        }
31
    }
32
}
33

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

    
43
# Language code for this installation. All choices can be found here:
44
# http://www.i18nguy.com/unicode/language-identifiers.html
45
_ = lambda s: s
46

    
47
LANGUAGES = (
48
    ('el', _('Greek')),
49
    ('en', _('English')),
50
)
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 = True
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 = True
65

    
66
# Absolute path to the directory that holds media.
67
# Example: "/home/media/media.lawrence.com/"
68
MEDIA_ROOT = ''
69

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

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

    
80
# Make this unique, and don't share it with anybody.
81
SECRET_KEY = 'fju0e4zu-thi7qf@93voi5eeot21@a*e54)%89xe-7iorqcimk'
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.contrib.auth.context_processors.auth",
92
    "django.core.context_processors.debug",
93
    "django.core.context_processors.i18n",
94
    "django.core.context_processors.media",
95
    "django.contrib.messages.context_processors.messages"
96
)
97

    
98
MIDDLEWARE_CLASSES = (
99
    'django.middleware.cache.UpdateCacheMiddleware',
100
    'django.middleware.common.CommonMiddleware',
101
    'django.contrib.sessions.middleware.SessionMiddleware',
102
    'django.middleware.csrf.CsrfViewMiddleware',
103
    'django.contrib.auth.middleware.AuthenticationMiddleware',
104
    'django.contrib.messages.middleware.MessageMiddleware',
105
    'django.middleware.cache.FetchFromCacheMiddleware',
106
)
107

    
108
AUTHENTICATION_BACKENDS = (
109
    'flowspy.djangobackends.shibauthBackend.shibauthBackend',
110
    'django.contrib.auth.backends.ModelBackend',
111
)
112

    
113
ROOT_URLCONF = 'flowspy.urls'
114

    
115
STATIC_URL = ''
116

    
117
TEMPLATE_DIRS = (
118
    '/home/leopoul/projects/flowspy/templates/',
119
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
120
    # Always use forward slashes, even on Windows.
121
    # Don't forget to use absolute paths, not relative paths.
122
)
123

    
124
INSTALLED_APPS = (
125
    'monkey_patch',
126
    'django.contrib.auth',
127
    'django.contrib.contenttypes',
128
    'django.contrib.sessions',
129
    'django.contrib.sites',
130
    'django.contrib.messages',
131
    'flowspec',
132
    'poller',
133
#    'south',
134
    # Uncomment the next line to enable the admin:
135
    'django.contrib.admin',
136
    # Uncomment the next line to enable admin documentation:
137
    'django.contrib.admindocs',
138
    'django_extensions',
139
    'djcelery',
140
    'peers',
141
    'accounts'
142
)
143

    
144
LOGIN_URL = '/fod/welcome'
145

    
146
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=3600"
147

    
148
AUTH_PROFILE_MODULE = 'accounts.UserProfile'
149

    
150
NETCONF_DEVICE = ""
151
NETCONF_USER = ""
152
NETCONF_PASS = ""
153
ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>"
154
ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>"
155
COMMIT_CONFIRMED_TIMEOUT = "120"
156
EXPIRATION_DAYS_OFFSET = 7
157
COMMIT = True
158

    
159
USE_X_FORWARDED_HOST = True
160

    
161
BROKER_HOST = "localhost"
162
BROKER_PORT = 11300
163
POLLS_TUBE = 'polls'
164

    
165
BROKER_VHOST = "/"
166
CELERY_CONCURRENCY = 1
167

    
168
# List of modules to import when celery starts.
169
CELERY_IMPORTS = ("flowspec.tasks", )
170

    
171
SERVER_EMAIL = "noreply@grnet.gr"
172
EMAIL_SUBJECT_PREFIX = "[FoD] "
173

    
174
LOG_FILE_LOCATION = here("log")
175

    
176
EXPIRATION_NOTIFY_DAYS = 4
177
PREFIX_LENGTH = 29 
178
POLL_SESSION_UPDATE = 60.0
179

    
180
BROKER_URL = "beanstalk://localhost:11300//"
181

    
182
SHIB_AUTH_AFFILIATION = 'urn:mace:grnet.gr:pki:user'
183
SHIB_ADMIN_DOMAIN = 'grnet.gr'
184
SHIB_LOGOUT_URL = 'https://netdev.grnet.gr/Shibboleth.sso/Logout'
185

    
186
HELPDESK_MAIL = ""
187
NOC_MAIL = ""
188

    
189
UI_USER_THEN_ACTIONS = ['discard', 'rate-limit']
190

    
191
PROTECTED_SUBNETS = ['10.10.0.0/16']
192

    
193
CELERYBEAT_SCHEDULE = {
194
    # Executes every day at 01:35 AM 
195
    "every-day-sync": {
196
        "task": "flowspec.tasks.check_sync",
197
        "schedule": crontab(minute=01, hour=01),
198
        "args": (),
199
    },
200
}