Fixed file logging mechanism bug. Added prefix_length restriction
[flowspy] / settings.py.dist
1 # Django settings for flowspy project.
2
3 import os
4 import djcelery
5 djcelery.setup_loader()
6 from celery.schedules import crontab
7
8 DEBUG = True
9 TEMPLATE_DEBUG = DEBUG
10
11 ADMINS = (
12     ('Admin', 'admin_mail@admin.ad'),
13 )
14
15
16 here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x)
17
18
19
20 MANAGERS = ADMINS
21
22 DATABASES = {
23     'default': {
24         'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
25         'NAME': '',                      # Or path to database file if using sqlite3.
26         'USER': '',                      # Not used with sqlite3.
27         'PASSWORD': '',                  # Not used with sqlite3.
28         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
29         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
30         'OPTIONS':  {
31         "init_command": "SET storage_engine=INNODB",
32 }
33     }
34 }
35
36 # Local time zone for this installation. Choices can be found here:
37 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
38 # although not all choices may be available on all operating systems.
39 # On Unix systems, a value of None will cause Django to use the same
40 # timezone as the operating system.
41 # If running in a Windows environment this must be set to the same as your
42 # system time zone.
43 TIME_ZONE = 'Europe/Athens'
44
45 # Language code for this installation. All choices can be found here:
46 # http://www.i18nguy.com/unicode/language-identifiers.html
47 _ = lambda s: s
48
49 LANGUAGES = (
50     ('el', _('Greek')),
51     ('en', _('English')),
52 )
53
54 # Language code for this installation. All choices can be found here:
55 # http://www.i18nguy.com/unicode/language-identifiers.html
56 LANGUAGE_CODE = 'en-us'
57
58 SITE_ID = 1
59
60 # If you set this to False, Django will make some optimizations so as not
61 # to load the internationalization machinery.
62 USE_I18N = True
63
64 # If you set this to False, Django will not format dates, numbers and
65 # calendars according to the current locale
66 USE_L10N = True
67
68 # Absolute path to the directory that holds media.
69 # Example: "/home/media/media.lawrence.com/"
70 MEDIA_ROOT = ''
71
72 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
73 # trailing slash if there is a path component (optional in other cases).
74 # Examples: "http://media.lawrence.com", "http://example.com/media/"
75 MEDIA_URL = ''
76
77 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
78 # trailing slash.
79 # Examples: "http://foo.com/media/", "/media/".
80 ADMIN_MEDIA_PREFIX = '/admin/media/'
81
82 # Make this unique, and don't share it with anybody.
83 SECRET_KEY = 'fju0e4zu-thi7qf@93voi5eeot21@a*e54)%89xe-7iorqcimk'
84
85 # List of callables that know how to import templates from various sources.
86 TEMPLATE_LOADERS = (
87     'django.template.loaders.filesystem.Loader',
88     'django.template.loaders.app_directories.Loader',
89 #     'django.template.loaders.eggs.Loader',
90 )
91
92 TEMPLATE_CONTEXT_PROCESSORS = (
93     "django.contrib.auth.context_processors.auth",
94     "django.core.context_processors.debug",
95     "django.core.context_processors.i18n",
96     "django.core.context_processors.media",
97     "django.contrib.messages.context_processors.messages"
98 )
99
100 MIDDLEWARE_CLASSES = (
101     'django.middleware.cache.UpdateCacheMiddleware',
102     'django.middleware.common.CommonMiddleware',
103     'django.contrib.sessions.middleware.SessionMiddleware',
104     'django.middleware.csrf.CsrfViewMiddleware',
105     'django.contrib.auth.middleware.AuthenticationMiddleware',
106     'django.contrib.messages.middleware.MessageMiddleware',
107     'django.middleware.cache.FetchFromCacheMiddleware',
108 )
109
110 AUTHENTICATION_BACKENDS = (
111     'flowspy.djangobackends.shibauthBackend.shibauthBackend',
112     'django.contrib.auth.backends.ModelBackend',
113 )
114
115 ROOT_URLCONF = 'flowspy.urls'
116
117 STATIC_URL = '/home/leopoul/projects/flowspy/static'
118
119 TEMPLATE_DIRS = (
120     '/home/leopoul/projects/flowspy/templates/',
121     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
122     # Always use forward slashes, even on Windows.
123     # Don't forget to use absolute paths, not relative paths.
124 )
125
126 INSTALLED_APPS = (
127     'monkey_patch',
128     'django.contrib.auth',
129     'django.contrib.contenttypes',
130     'django.contrib.sessions',
131     'django.contrib.sites',
132     'django.contrib.messages',
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     'accounts'
144 )
145
146 LOGIN_URL = '/fod/welcome'
147
148 CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=3600"
149
150 AUTH_PROFILE_MODULE = 'accounts.UserProfile'
151
152 NETCONF_DEVICE = ""
153 NETCONF_USER = ""
154 NETCONF_PASS = ""
155
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 BROKER_VHOST = "/"
168 CELERY_CONCURRENCY = 1
169
170 # List of modules to import when celery starts.
171 CELERY_IMPORTS = ("flowspec.tasks", )
172
173 SERVER_EMAIL = "noreply@grnet.gr"
174 EMAIL_SUBJECT_PREFIX = "[FoD] "
175
176 LOG_FILE_LOCATION = here("log")
177
178 EXPIRATION_NOTIFY_DAYS = 4
179 PREFIX_LENGTH = 32 
180 POLL_SESSION_UPDATE = 60.0
181
182 BROKER_URL = "beanstalk://localhost:11300//"
183
184 SHIB_AUTH_AFFILIATION = 'urn:mace:grnet.gr:pki:user'
185 SHIB_ADMIN_DOMAIN = 'grnet.gr'
186 SHIB_LOGOUT_URL = 'https://netdev.grnet.gr/Shibboleth.sso/Logout'
187
188 CELERYBEAT_SCHEDULE = {
189     # Executes every day at 01:35 AM 
190     "every-day-sync": {
191         "task": "flowspec.tasks.check_sync",
192         "schedule": crontab(minute=01, hour=01),
193         "args": (),
194     },
195 }