root / settings.py.dist @ 93fc8356
History | View | Annotate | Download (6.3 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 = False |
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.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
23 |
'NAME': 'flowspec', # 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=MYISAM", |
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 |
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', |
107 |
) |
108 |
|
109 |
AUTHENTICATION_BACKENDS = ( |
110 |
'flowspy.djangobackends.shibauthBackend.shibauthBackend', |
111 |
'django.contrib.auth.backends.ModelBackend', |
112 |
) |
113 |
|
114 |
ROOT_URLCONF = 'flowspy.urls' |
115 |
|
116 |
STATIC_URL = '/path/to/static' |
117 |
|
118 |
TEMPLATE_DIRS = ( |
119 |
'/path/to/templates/', |
120 |
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
121 |
# Always use forward slashes, even on Windows. |
122 |
# Don't forget to use absolute paths, not relative paths. |
123 |
) |
124 |
|
125 |
INSTALLED_APPS = ( |
126 |
'monkey_patch', |
127 |
'django.contrib.auth', |
128 |
'django.contrib.contenttypes', |
129 |
'django.contrib.sessions', |
130 |
'django.contrib.sites', |
131 |
'django.contrib.messages', |
132 |
'django.contrib.flatpages', |
133 |
'flowspec', |
134 |
'poller', |
135 |
'south', |
136 |
# Uncomment the next line to enable the admin: |
137 |
'django.contrib.admin', |
138 |
# Uncomment the next line to enable admin documentation: |
139 |
'django.contrib.admindocs', |
140 |
'django_extensions', |
141 |
'djcelery', |
142 |
'peers', |
143 |
'registration', |
144 |
'accounts' |
145 |
) |
146 |
|
147 |
LOGIN_URL = '/fod/welcome' |
148 |
|
149 |
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=3600" |
150 |
|
151 |
AUTH_PROFILE_MODULE = 'accounts.UserProfile' |
152 |
|
153 |
NETCONF_DEVICE = "" |
154 |
NETCONF_USER = "" |
155 |
NETCONF_PASS = "" |
156 |
ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>" |
157 |
ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>" |
158 |
COMMIT_CONFIRMED_TIMEOUT = "120" |
159 |
EXPIRATION_DAYS_OFFSET = 7 |
160 |
COMMIT = True |
161 |
|
162 |
USE_X_FORWARDED_HOST = True |
163 |
|
164 |
BROKER_HOST = "localhost" |
165 |
BROKER_PORT = 11300 |
166 |
POLLS_TUBE = 'polls' |
167 |
|
168 |
BROKER_VHOST = "/" |
169 |
CELERY_CONCURRENCY = 1 |
170 |
|
171 |
# List of modules to import when celery starts. |
172 |
CELERY_IMPORTS = ("flowspec.tasks", ) |
173 |
|
174 |
SERVER_EMAIL = "GRNET FoD Service <noreply@grnet.gr>" |
175 |
EMAIL_SUBJECT_PREFIX = "[FoD] " |
176 |
|
177 |
LOG_FILE_LOCATION = here("log") |
178 |
|
179 |
EXPIRATION_NOTIFY_DAYS = 4 |
180 |
PREFIX_LENGTH = 29 |
181 |
POLL_SESSION_UPDATE = 60.0 |
182 |
|
183 |
BROKER_URL = "beanstalk://localhost:11300//" |
184 |
|
185 |
SHIB_AUTH_ENTITLEMENT = 'urn:mace' |
186 |
SHIB_ADMIN_DOMAIN = 'grnet.gr' |
187 |
SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout' |
188 |
|
189 |
# BCC mail addresses |
190 |
NOTIFY_ADMIN_MAILS = ["admin@admin.com"] |
191 |
|
192 |
UI_USER_THEN_ACTIONS = ['discard', 'rate-limit'] |
193 |
UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp'] |
194 |
|
195 |
PROTECTED_SUBNETS = ['10.10.0.0/16'] |
196 |
|
197 |
CELERYBEAT_SCHEDULE = { |
198 |
"every-day-sync": { |
199 |
"task": "flowspec.tasks.check_sync", |
200 |
"schedule": crontab(minute=01, hour=01), |
201 |
"args": (), |
202 |
}, |
203 |
"notify-expired": { |
204 |
"task": "flowspec.tasks.notify_expired", |
205 |
"schedule": crontab(minute=01, hour=02), |
206 |
"args": (), |
207 |
}, |
208 |
} |
209 |
# whois |
210 |
PRIMARY_WHOIS = 'whois.grnet.gr' |
211 |
ALTERNATE_WHOIS = 'whois.ripe.net' |
212 |
|
213 |
ACCOUNT_ACTIVATION_DAYS = 7 |