root / settings.py.dist @ 6ecbf4ec
History | View | Annotate | Download (6.9 kB)
1 |
# Django settings for grnet project. |
---|---|
2 |
# -*- coding: utf-8 -*- vim:encoding=utf-8: |
3 |
# vim: tabstop=4:shiftwidth=4:softtabstop=4:expandtab |
4 |
import os |
5 |
import djcelery |
6 |
djcelery.setup_loader() |
7 |
from celery.schedules import crontab |
8 |
DEBUG = False |
9 |
TEMPLATE_DEBUG = DEBUG |
10 |
|
11 |
ADMINS = ( |
12 |
('AdminName', 'adminmail@admin.com'), |
13 |
) |
14 |
|
15 |
here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x) |
16 |
|
17 |
|
18 |
|
19 |
MANAGERS = ADMINS |
20 |
|
21 |
DATABASES = { |
22 |
'default': { |
23 |
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
24 |
'NAME': 'flowspec', # Or path to database file if using sqlite3. |
25 |
'USER': '', # Not used with sqlite3. |
26 |
'PASSWORD': '', # Not used with sqlite3. |
27 |
'HOST': '', # Set to empty string for localhost. Not used with sqlite3. |
28 |
'PORT': '', # Set to empty string for default. Not used with sqlite3. |
29 |
'OPTIONS': { |
30 |
"init_command": "SET storage_engine=MYISAM", |
31 |
} |
32 |
} |
33 |
} |
34 |
|
35 |
# Local time zone for this installation. Choices can be found here: |
36 |
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
37 |
# although not all choices may be available on all operating systems. |
38 |
# On Unix systems, a value of None will cause Django to use the same |
39 |
# timezone as the operating system. |
40 |
# If running in a Windows environment this must be set to the same as your |
41 |
# system time zone. |
42 |
TIME_ZONE = 'Europe/Athens' |
43 |
|
44 |
# Language code for this installation. All choices can be found here: |
45 |
# http://www.i18nguy.com/unicode/language-identifiers.html |
46 |
_ = lambda s: s |
47 |
|
48 |
LANGUAGES = ( |
49 |
('el', _('Greek')), |
50 |
('en', _('English')), |
51 |
) |
52 |
|
53 |
# Language code for this installation. All choices can be found here: |
54 |
# http://www.i18nguy.com/unicode/language-identifiers.html |
55 |
LANGUAGE_CODE = 'en' |
56 |
|
57 |
SITE_ID = 1 |
58 |
|
59 |
# If you set this to False, Django will make some optimizations so as not |
60 |
# to load the internationalization machinery. |
61 |
USE_I18N = True |
62 |
|
63 |
# If you set this to False, Django will not format dates, numbers and |
64 |
# calendars according to the current locale |
65 |
USE_L10N = True |
66 |
|
67 |
# Absolute path to the directory that holds media. |
68 |
# Example: "/home/media/media.lawrence.com/" |
69 |
MEDIA_ROOT = '' |
70 |
|
71 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
72 |
# trailing slash if there is a path component (optional in other cases). |
73 |
# Examples: "http://media.lawrence.com", "http://example.com/media/" |
74 |
MEDIA_URL = '' |
75 |
|
76 |
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
77 |
# trailing slash. |
78 |
# Examples: "http://foo.com/media/", "/media/". |
79 |
ADMIN_MEDIA_PREFIX = '/admin/media/' |
80 |
|
81 |
# Make this unique, and don't share it with anybody. |
82 |
SECRET_KEY = 'fju0e4zu-thi7qf@93voi5eeot21@a*e54)%89xe-7iorqcimk' |
83 |
|
84 |
# List of callables that know how to import templates from various sources. |
85 |
TEMPLATE_LOADERS = ( |
86 |
'django.template.loaders.filesystem.Loader', |
87 |
'django.template.loaders.app_directories.Loader', |
88 |
# 'django.template.loaders.eggs.Loader', |
89 |
) |
90 |
|
91 |
TEMPLATE_CONTEXT_PROCESSORS = ( |
92 |
"django.contrib.auth.context_processors.auth", |
93 |
"django.core.context_processors.debug", |
94 |
"django.core.context_processors.i18n", |
95 |
"django.core.context_processors.media", |
96 |
"django.contrib.messages.context_processors.messages" |
97 |
) |
98 |
|
99 |
MIDDLEWARE_CLASSES = ( |
100 |
'django.middleware.cache.UpdateCacheMiddleware', |
101 |
'django.middleware.common.CommonMiddleware', |
102 |
'django.contrib.sessions.middleware.SessionMiddleware', |
103 |
'django.middleware.locale.LocaleMiddleware', |
104 |
'django.middleware.csrf.CsrfViewMiddleware', |
105 |
'django.contrib.auth.middleware.AuthenticationMiddleware', |
106 |
'django.contrib.messages.middleware.MessageMiddleware', |
107 |
'django.middleware.cache.FetchFromCacheMiddleware', |
108 |
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', |
109 |
) |
110 |
|
111 |
AUTHENTICATION_BACKENDS = ( |
112 |
'flowspy.djangobackends.shibauthBackend.shibauthBackend', |
113 |
'django.contrib.auth.backends.ModelBackend', |
114 |
) |
115 |
|
116 |
ROOT_URLCONF = 'flowspy.urls' |
117 |
|
118 |
STATIC_URL = '/path/to/static' |
119 |
|
120 |
TEMPLATE_DIRS = ( |
121 |
'/path/to/templates/', |
122 |
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
123 |
# Always use forward slashes, even on Windows. |
124 |
# Don't forget to use absolute paths, not relative paths. |
125 |
) |
126 |
|
127 |
INSTALLED_APPS = ( |
128 |
'monkey_patch', |
129 |
'django.contrib.auth', |
130 |
'django.contrib.contenttypes', |
131 |
'django.contrib.sessions', |
132 |
'django.contrib.sites', |
133 |
'django.contrib.messages', |
134 |
'django.contrib.flatpages', |
135 |
'flowspec', |
136 |
'poller', |
137 |
'south', |
138 |
# Uncomment the next line to enable the admin: |
139 |
'django.contrib.admin', |
140 |
# Uncomment the next line to enable admin documentation: |
141 |
'django.contrib.admindocs', |
142 |
'django_extensions', |
143 |
'djcelery', |
144 |
'peers', |
145 |
'registration', |
146 |
'accounts', |
147 |
'tinymce', |
148 |
) |
149 |
|
150 |
LOGIN_URL = '/fod/welcome' |
151 |
|
152 |
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=3600" |
153 |
|
154 |
AUTH_PROFILE_MODULE = 'accounts.UserProfile' |
155 |
|
156 |
NETCONF_DEVICE = "" |
157 |
NETCONF_USER = "" |
158 |
NETCONF_PASS = "" |
159 |
ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>" |
160 |
ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>" |
161 |
COMMIT_CONFIRMED_TIMEOUT = "120" |
162 |
EXPIRATION_DAYS_OFFSET = 7 |
163 |
COMMIT = True |
164 |
|
165 |
USE_X_FORWARDED_HOST = True |
166 |
|
167 |
BROKER_HOST = "localhost" |
168 |
BROKER_PORT = 11300 |
169 |
POLLS_TUBE = 'polls' |
170 |
|
171 |
BROKER_VHOST = "/" |
172 |
CELERY_CONCURRENCY = 1 |
173 |
|
174 |
# List of modules to import when celery starts. |
175 |
CELERY_IMPORTS = ("flowspec.tasks", ) |
176 |
|
177 |
SERVER_EMAIL = "GRNET FoD Service <noreply@grnet.gr>" |
178 |
EMAIL_SUBJECT_PREFIX = "[FoD] " |
179 |
|
180 |
LOG_FILE_LOCATION = here("log") |
181 |
|
182 |
EXPIRATION_NOTIFY_DAYS = 4 |
183 |
PREFIX_LENGTH = 29 |
184 |
POLL_SESSION_UPDATE = 60.0 |
185 |
|
186 |
BROKER_URL = "beanstalk://localhost:11300//" |
187 |
|
188 |
SHIB_AUTH_ENTITLEMENT = 'urn:mace' |
189 |
SHIB_ADMIN_DOMAIN = 'grnet.gr' |
190 |
SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout' |
191 |
|
192 |
# BCC mail addresses |
193 |
NOTIFY_ADMIN_MAILS = ["admin@admin.com"] |
194 |
|
195 |
UI_USER_THEN_ACTIONS = ['discard', 'rate-limit'] |
196 |
UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp'] |
197 |
|
198 |
PROTECTED_SUBNETS = ['10.10.0.0/16'] |
199 |
|
200 |
CELERYBEAT_SCHEDULE = { |
201 |
"every-day-sync": { |
202 |
"task": "flowspec.tasks.check_sync", |
203 |
"schedule": crontab(minute=01, hour=01), |
204 |
"args": (), |
205 |
}, |
206 |
"notify-expired": { |
207 |
"task": "flowspec.tasks.notify_expired", |
208 |
"schedule": crontab(minute=01, hour=02), |
209 |
"args": (), |
210 |
}, |
211 |
} |
212 |
# whois |
213 |
PRIMARY_WHOIS = 'whois.grnet.gr' |
214 |
ALTERNATE_WHOIS = 'whois.ripe.net' |
215 |
|
216 |
ACCOUNT_ACTIVATION_DAYS = 7 |
217 |
|
218 |
#Shibboleth attribute map |
219 |
SHIB_USERNAME = ['HTTP_EPPN'] |
220 |
SHIB_MAIL = ['mail', 'HTTP_MAIL', 'HTTP_SHIB_INETORGPERSON_MAIL'] |
221 |
SHIB_FIRSTNAME = ['HTTP_SHIB_INETORGPERSON_GIVENNAME'] |
222 |
SHIB_LASTNAME = ['HTTP_SHIB_PERSON_SURNAME'] |
223 |
SHIB_ENTITLEMENT = ['HTTP_SHIB_EP_ENTITLEMENT'] |
224 |
|
225 |
TINYMCE_JS_URL = '/static/js/tinymce/tiny_mce.js' |
226 |
|
227 |
TINYMCE_DEFAULT_CONFIG = { |
228 |
'extended_valid_elements' : 'iframe[src|width|height|name|align]', |
229 |
'plugins': "table,spellchecker,paste,searchreplace", |
230 |
'theme': "advanced", |
231 |
} |
232 |
|
233 |
|