Statistics
| Branch: | Tag: | Revision:

root / flowspy / settings.py.dist @ 0bf16f7f

History | View | Annotate | Download (10.1 kB)

1
# -*- coding: utf-8 -*- vim:fileencoding=utf-8:
2
# vim: tabstop=4:shiftwidth=4:softtabstop=4:expandtab
3
# Django settings for flowspy project.
4
# Copyright © 2011-2014 Greek Research and Technology Network (GRNET S.A.)
5
# Copyright © 2011-2014 Leonidas Poulopoulos (@leopoul)
6
# 
7
# Permission to use, copy, modify, and/or distribute this software for any
8
# purpose with or without fee is hereby granted, provided that the above
9
# copyright notice and this permission notice appear in all copies.
10
# 
11
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
12
# TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
13
# FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
14
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
15
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
16
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
17
# SOFTWARE.
18

    
19
import os
20
import djcelery
21
djcelery.setup_loader()
22
from celery.schedules import crontab
23

    
24
DEBUG = False
25
TEMPLATE_DEBUG = DEBUG
26

    
27
ADMINS = (
28
    ('AdminName', 'adminmail@admin.com'),
29
)
30
MANAGERS = ADMINS
31
here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x)
32

    
33

    
34
DATABASES = {
35
    'default': {
36
        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
37
        'NAME': '',                      # Or path to database file if using sqlite3.
38
        'USER': '',                      # Not used with sqlite3.
39
        'PASSWORD': '',                  # Not used with sqlite3.
40
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
41
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
42
    }
43
}
44

    
45
# Hosts/domain names that are valid for this site; required if DEBUG is False
46
# See https://docs.djangoproject.com/en/1.4/ref/settings/#allowed-hosts
47
ALLOWED_HOSTS = []
48

    
49
# Local time zone for this installation. Choices can be found here:
50
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
51
# although not all choices may be available on all operating systems.
52
# In a Windows environment this must be set to your system time zone.
53
TIME_ZONE = 'Europe/Athens'
54

    
55
# Language code for this installation. All choices can be found here:
56
# http://www.i18nguy.com/unicode/language-identifiers.html
57
_ = lambda s: s
58

    
59
LANGUAGES = (
60
    ('el', _('Greek')),
61
    ('en', _('English')),
62
)
63

    
64
# Language code for this installation. All choices can be found here:
65
# http://www.i18nguy.com/unicode/language-identifiers.html
66
LANGUAGE_CODE = 'en'
67

    
68
LOCALE_PATHS = (  
69
    os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'locale'),  
70
)
71

    
72
SITE_ID = 1
73

    
74
# If you set this to False, Django will make some optimizations so as not
75
# to load the internationalization machinery.
76
USE_I18N = True
77

    
78
# If you set this to False, Django will not format dates, numbers and
79
# calendars according to the current locale.
80
USE_L10N = True
81

    
82
# If you set this to False, Django will not use timezone-aware datetimes.
83
USE_TZ = True
84

    
85
# Absolute filesystem path to the directory that will hold user-uploaded files.
86
# Example: "/home/media/media.lawrence.com/media/"
87
MEDIA_ROOT = ''
88

    
89
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
90
# trailing slash.
91
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
92
MEDIA_URL = ''
93

    
94
# Absolute path to the directory static files should be collected to.
95
# Don't put anything in this directory yourself; store your static files
96
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
97
# Example: "/home/media/media.lawrence.com/static/"
98
STATIC_ROOT = '/path/to/projects/flowspy/static'
99

    
100
# URL prefix for static files.
101
# Example: "http://media.lawrence.com/static/"
102
STATIC_URL = 'https://example.com/static/'
103

    
104
# Additional locations of static files
105
STATICFILES_DIRS = (
106
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
107
    # Always use forward slashes, even on Windows.
108
    # Don't forget to use absolute paths, not relative paths.
109
)
110

    
111
# List of finder classes that know how to find static files in
112
# various locations.
113
STATICFILES_FINDERS = (
114
    'django.contrib.staticfiles.finders.FileSystemFinder',
115
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
116
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
117
)
118

    
119
# Make this unique, and don't share it with anybody.
120
SECRET_KEY = '<PLACE RANDOM CHARS HERE>eg. @@5234#$%345345^@#$%*()123^@12!&!()$JMNDF#$@(@#8FRNJWX_'
121

    
122
# List of callables that know how to import templates from various sources.
123
TEMPLATE_LOADERS = (
124
    'django.template.loaders.filesystem.Loader',
125
    'django.template.loaders.app_directories.Loader',
126
#     'django.template.loaders.eggs.Loader',
127
)
128

    
129
TEMPLATE_CONTEXT_PROCESSORS = (
130
    "django.contrib.auth.context_processors.auth",
131
    "django.core.context_processors.debug",
132
    "django.core.context_processors.i18n",
133
    "django.core.context_processors.media",
134
    "django.core.context_processors.static",
135
    "django.contrib.messages.context_processors.messages",
136
    "context.global_vars.settings_vars",
137
)
138

    
139
MIDDLEWARE_CLASSES = (
140
    'django.middleware.cache.UpdateCacheMiddleware',
141
    'django.middleware.common.CommonMiddleware',
142
    'django.contrib.sessions.middleware.SessionMiddleware',
143
    'django.middleware.locale.LocaleMiddleware',
144
    'django.middleware.csrf.CsrfViewMiddleware',
145
    'django.contrib.auth.middleware.AuthenticationMiddleware',
146
    'django.contrib.messages.middleware.MessageMiddleware',
147
    # Uncomment the next line for simple clickjacking protection:
148
    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
149
    'django.middleware.cache.FetchFromCacheMiddleware',
150
    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
151
)
152

    
153
ROOT_URLCONF = 'flowspy.urls'
154

    
155
# Python dotted path to the WSGI application used by Django's runserver.
156
WSGI_APPLICATION = 'flowspy.wsgi.application'
157

    
158
AUTHENTICATION_BACKENDS = (
159
    'djangobackends.shibauthBackend.shibauthBackend',
160
    'django.contrib.auth.backends.ModelBackend',
161
)
162

    
163
TEMPLATE_DIRS = (
164
	'/path/to/templates/',
165
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
166
    # Always use forward slashes, even on Windows.
167
    # Don't forget to use absolute paths, not relative paths.
168
)
169

    
170
INSTALLED_APPS = (
171
    'monkey_patch',
172
    'django.contrib.auth',
173
    'django.contrib.contenttypes',
174
    'django.contrib.sessions',
175
    'django.contrib.sites',
176
    'django.contrib.flatpages',
177
    'django.contrib.messages',
178
    'django.contrib.staticfiles',
179
    'flowspec',
180
    'poller',
181
    'south',
182
    # Uncomment the next line to enable the admin:
183
    'django.contrib.admin',
184
    # Uncomment the next line to enable admin documentation:
185
    # 'django.contrib.admindocs',
186
    'djcelery',
187
    'peers',
188
	'registration',
189
    'accounts',
190
    'tinymce',
191
    'widget_tweaks',
192
)
193

    
194
# A sample logging configuration. The only tangible logging
195
# performed by this configuration is to send an email to
196
# the site admins on every HTTP 500 error when DEBUG=False.
197
# See http://docs.djangoproject.com/en/dev/topics/logging for
198
# more details on how to customize your logging configuration.
199
LOGGING = {
200
    'version': 1,
201
    'disable_existing_loggers': False,
202
    'filters': {
203
        'require_debug_false': {
204
            '()': 'django.utils.log.RequireDebugFalse'
205
        }
206
    },
207
    'handlers': {
208
        'mail_admins': {
209
            'level': 'ERROR',
210
            'filters': ['require_debug_false'],
211
            'class': 'django.utils.log.AdminEmailHandler'
212
        }
213
    },
214
    'loggers': {
215
        'django.request': {
216
            'handlers': ['mail_admins'],
217
            'level': 'ERROR',
218
            'propagate': True,
219
        },
220
    }
221
}
222

    
223
LOGIN_URL = '/welcome'
224

    
225
# CACHES = {
226
#     'default': {
227
#         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
228
#         'LOCATION': '127.0.0.1:11211',
229
#     }
230
# }
231
CACHES = {
232
    'default': {
233
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
234
    }
235
}
236

    
237
AUTH_PROFILE_MODULE = 'accounts.UserProfile'
238

    
239
NETCONF_DEVICE = ""
240
NETCONF_USER = ""
241
NETCONF_PASS = ""
242
NETCONF_PORT = 830
243

    
244
ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>"
245
ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>"
246
COMMIT_CONFIRMED_TIMEOUT = "120"
247
EXPIRATION_DAYS_OFFSET = 7
248
COMMIT = True
249

    
250
USE_X_FORWARDED_HOST = True
251

    
252
BROKER_HOST = "localhost"
253
BROKER_PORT = 11300
254
POLLS_TUBE = 'polls'
255

    
256
BROKER_VHOST = "/"
257
CELERY_CONCURRENCY = 1
258

    
259
# List of modules to import when celery starts.
260
CELERY_IMPORTS = ("flowspec.tasks", )
261

    
262
SERVER_EMAIL = "Example FoD Service <noreply@example.com>"
263
EMAIL_SUBJECT_PREFIX = "[FoD] "
264

    
265
LOG_FILE_LOCATION = here("log")
266

    
267
EXPIRATION_NOTIFY_DAYS = 4
268
PREFIX_LENGTH = 29
269
POLL_SESSION_UPDATE = 60.0
270

    
271
BROKER_URL = "beanstalk://localhost:11300//"
272

    
273
SHIB_AUTH_ENTITLEMENT = 'urn:mace'
274
SHIB_ADMIN_DOMAIN = 'grnet.gr'
275
SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout'
276

    
277
# BCC mail addresses
278
NOTIFY_ADMIN_MAILS = ["admin@admin.com"]
279

    
280
UI_USER_THEN_ACTIONS = ['discard', 'rate-limit']
281
UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp']
282

    
283
PROTECTED_SUBNETS = ['10.10.0.0/16']
284

    
285
CELERYBEAT_SCHEDULE = {
286
    "every-day-sync": {
287
        "task": "flowspec.tasks.check_sync",
288
        "schedule": crontab(minute=01, hour=01),
289
        "args": (),
290
    },
291
    "notify-expired": {
292
        "task": "flowspec.tasks.notify_expired",
293
        "schedule": crontab(minute=01, hour=02),
294
        "args": (),
295
    },
296
}
297
# whois
298
PRIMARY_WHOIS = 'whois.example.com'
299
ALTERNATE_WHOIS = 'whois.example.net'
300

    
301
ACCOUNT_ACTIVATION_DAYS = 7
302

    
303
#Shibboleth attribute map
304
SHIB_USERNAME = ['HTTP_EPPN']
305
SHIB_MAIL = ['mail', 'HTTP_MAIL', 'HTTP_SHIB_INETORGPERSON_MAIL']
306
SHIB_FIRSTNAME = ['HTTP_SHIB_INETORGPERSON_GIVENNAME']
307
SHIB_LASTNAME = ['HTTP_SHIB_PERSON_SURNAME']
308
SHIB_ENTITLEMENT = ['HTTP_SHIB_EP_ENTITLEMENT']
309

    
310
TINYMCE_JS_URL = STATIC_URL +'js/tinymce/tiny_mce.js'
311

    
312
TINYMCE_DEFAULT_CONFIG = {
313
    'extended_valid_elements' :  'iframe[src|width|height|name|align]',
314
    'plugins': "table,spellchecker,paste,searchreplace",
315
    'theme': "advanced",
316
}
317

    
318
import _version
319
SW_VERSION = _version.VERSION
320

    
321
LOG_FILE_LOCATION = here("../log")
322

    
323