Statistics
| Branch: | Tag: | Revision:

root / settings.py.dist @ 4d02b9bc

History | View | Annotate | Download (6.4 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
)
148

    
149
LOGIN_URL = '/fod/welcome'
150

    
151
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=3600"
152

    
153
AUTH_PROFILE_MODULE = 'accounts.UserProfile'
154

    
155
NETCONF_DEVICE = ""
156
NETCONF_USER = ""
157
NETCONF_PASS = ""
158
ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>"
159
ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>"
160
COMMIT_CONFIRMED_TIMEOUT = "120"
161
EXPIRATION_DAYS_OFFSET = 7
162
COMMIT = True
163

    
164
USE_X_FORWARDED_HOST = True
165

    
166
BROKER_HOST = "localhost"
167
BROKER_PORT = 11300
168
POLLS_TUBE = 'polls'
169

    
170
BROKER_VHOST = "/"
171
CELERY_CONCURRENCY = 1
172

    
173
# List of modules to import when celery starts.
174
CELERY_IMPORTS = ("flowspec.tasks", )
175

    
176
SERVER_EMAIL = "GRNET FoD Service <noreply@grnet.gr>"
177
EMAIL_SUBJECT_PREFIX = "[FoD] "
178

    
179
LOG_FILE_LOCATION = here("log")
180

    
181
EXPIRATION_NOTIFY_DAYS = 4
182
PREFIX_LENGTH = 29 
183
POLL_SESSION_UPDATE = 60.0
184

    
185
BROKER_URL = "beanstalk://localhost:11300//"
186

    
187
SHIB_AUTH_ENTITLEMENT = 'urn:mace'
188
SHIB_ADMIN_DOMAIN = 'grnet.gr'
189
SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout'
190

    
191
# BCC mail addresses
192
NOTIFY_ADMIN_MAILS = ["admin@admin.com"]
193

    
194
UI_USER_THEN_ACTIONS = ['discard', 'rate-limit']
195
UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp']
196

    
197
PROTECTED_SUBNETS = ['10.10.0.0/16']
198

    
199
CELERYBEAT_SCHEDULE = { 
200
    "every-day-sync": {
201
        "task": "flowspec.tasks.check_sync",
202
        "schedule": crontab(minute=01, hour=01),
203
        "args": (),
204
    },
205
    "notify-expired": {
206
        "task": "flowspec.tasks.notify_expired",
207
        "schedule": crontab(minute=01, hour=02),
208
        "args": (),
209
    },
210
}
211
# whois
212
PRIMARY_WHOIS = 'whois.grnet.gr'
213
ALTERNATE_WHOIS = 'whois.ripe.net'
214

    
215
ACCOUNT_ACTIVATION_DAYS = 7