1 # Django settings for flowspy project.
5 djcelery.setup_loader()
6 from celery.schedules import crontab
11 ('AdminName', 'adminmail@admin.com'),
14 here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x)
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.
29 "init_command": "SET storage_engine=MYISAM",
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
41 TIME_ZONE = 'Europe/Athens'
43 # Language code for this installation. All choices can be found here:
44 # http://www.i18nguy.com/unicode/language-identifiers.html
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'
58 # If you set this to False, Django will make some optimizations so as not
59 # to load the internationalization machinery.
62 # If you set this to False, Django will not format dates, numbers and
63 # calendars according to the current locale
66 # Absolute path to the directory that holds media.
67 # Example: "/home/media/media.lawrence.com/"
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/"
75 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
77 # Examples: "http://foo.com/media/", "/media/".
78 ADMIN_MEDIA_PREFIX = '/admin/media/'
80 # Make this unique, and don't share it with anybody.
81 SECRET_KEY = 'fju0e4zu-thi7qf@93voi5eeot21@a*e54)%89xe-7iorqcimk'
83 # List of callables that know how to import templates from various sources.
85 'django.template.loaders.filesystem.Loader',
86 'django.template.loaders.app_directories.Loader',
87 # 'django.template.loaders.eggs.Loader',
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"
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',
109 AUTHENTICATION_BACKENDS = (
110 'flowspy.djangobackends.shibauthBackend.shibauthBackend',
111 'django.contrib.auth.backends.ModelBackend',
114 ROOT_URLCONF = 'flowspy.urls'
116 STATIC_URL = '/path/to/static'
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.
127 'django.contrib.auth',
128 'django.contrib.contenttypes',
129 'django.contrib.sessions',
130 'django.contrib.sites',
131 'django.contrib.messages',
132 'django.contrib.flatpages',
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',
148 LOGIN_URL = '/fod/welcome'
150 CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=3600"
152 AUTH_PROFILE_MODULE = 'accounts.UserProfile'
157 ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>"
158 ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>"
159 COMMIT_CONFIRMED_TIMEOUT = "120"
160 EXPIRATION_DAYS_OFFSET = 7
163 USE_X_FORWARDED_HOST = True
165 BROKER_HOST = "localhost"
170 CELERY_CONCURRENCY = 1
172 # List of modules to import when celery starts.
173 CELERY_IMPORTS = ("flowspec.tasks", )
175 SERVER_EMAIL = "GRNET FoD Service <noreply@grnet.gr>"
176 EMAIL_SUBJECT_PREFIX = "[FoD] "
178 LOG_FILE_LOCATION = here("log")
180 EXPIRATION_NOTIFY_DAYS = 4
182 POLL_SESSION_UPDATE = 60.0
184 BROKER_URL = "beanstalk://localhost:11300//"
186 SHIB_AUTH_ENTITLEMENT = 'urn:mace'
187 SHIB_ADMIN_DOMAIN = 'grnet.gr'
188 SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout'
191 NOTIFY_ADMIN_MAILS = ["admin@admin.com"]
193 UI_USER_THEN_ACTIONS = ['discard', 'rate-limit']
195 PROTECTED_SUBNETS = ['10.10.0.0/16']
197 CELERYBEAT_SCHEDULE = {
199 "task": "flowspec.tasks.check_sync",
200 "schedule": crontab(minute=01, hour=01),
204 "task": "flowspec.tasks.notify_expired",
205 "schedule": crontab(minute=01, hour=02),
210 PRIMARY_WHOIS = 'whois.grnet.gr'
211 ALTERNATE_WHOIS = 'whois.ripe.net'
213 ACCOUNT_ACTIVATION_DAYS = 7
215 API_LIMIT_PER_PAGE = 0
216 APIKEY_RENEWAL_PERIOD = 7