We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add support for Django's redirect app to wafer
It's useful to be able to add a redirect if a page is moved to a different point in the hierachy.

Django's already got support for this, so we should leverage that.

The potentially problematic part is how this iteracts with the static site generation, as django-medusa's handling of redirects is far from ideal.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `wafer/settings.py`
Content:
```
1 import os
2 
3 from django.utils.translation import ugettext_lazy as _
4 
5 try:
6     from localsettings import *
7 except ImportError:
8     pass
9 
10 # Django settings for wafer project.
11 
12 ADMINS = (
13     # The logging config below mails admins
14     # ('Your Name', 'your_email@example.com'),
15 )
16 
17 DATABASES = {
18     'default': {
19         'ENGINE': 'django.db.backends.sqlite3',
20         'NAME': 'wafer.db',
21     }
22 }
23 
24 if os.environ.get('TESTDB', None) == 'postgres':
25     DATABASES['default'].update({
26         'ENGINE': 'django.db.backends.postgresql_psycopg2',
27         'USER': 'postgres',
28         'NAME': 'wafer',
29         })
30 
31 # Hosts/domain names that are valid for this site; required if DEBUG is False
32 # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
33 ALLOWED_HOSTS = []
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 # In a Windows environment this must be set to your system time zone.
39 TIME_ZONE = 'UTC'
40 
41 # Language code for this installation. All choices can be found here:
42 # http://www.i18nguy.com/unicode/language-identifiers.html
43 LANGUAGE_CODE = 'en-us'
44 
45 SITE_ID = 1
46 
47 # If you set this to False, Django will make some optimizations so as not
48 # to load the internationalization machinery.
49 USE_I18N = True
50 
51 # If you set this to False, Django will not format dates, numbers and
52 # calendars according to the current locale.
53 USE_L10N = True
54 
55 # If you set this to False, Django will not use timezone-aware datetimes.
56 USE_TZ = True
57 
58 # Absolute filesystem path to the directory that will hold user-uploaded files.
59 # Example: "/var/www/example.com/media/"
60 project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
61 MEDIA_ROOT = os.path.join(project_root, 'media')
62 
63 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
64 # trailing slash.
65 # Examples: "http://example.com/media/", "http://media.example.com/"
66 MEDIA_URL = '/media/'
67 
68 # Absolute path to the directory static files should be collected to.
69 # Don't put anything in this directory yourself; store your static files
70 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
71 # Example: "/var/www/example.com/static/"
72 STATIC_ROOT = ''
73 
74 # URL prefix for static files.
75 # Example: "http://example.com/static/", "http://static.example.com/"
76 STATIC_URL = '/static/'
77 
78 # Additional locations of static files
79 STATICFILES_DIRS = (
80     # Put strings here, like "/home/html/static" or "C:/www/django/static".
81     # Always use forward slashes, even on Windows.
82     # Don't forget to use absolute paths, not relative paths.
83     os.path.join(project_root, 'bower_components'),
84 )
85 
86 # List of finder classes that know how to find static files in
87 # various locations.
88 STATICFILES_FINDERS = (
89     'django.contrib.staticfiles.finders.FileSystemFinder',
90     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
91     # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
92 )
93 
94 # Make this unique, and don't share it with anybody.
95 SECRET_KEY = '8iysa30^no&oi5kv$k1w)#gsxzrylr-h6%)loz71expnbf7z%)'
96 
97 # List of callables that know how to import templates from various sources.
98 TEMPLATE_LOADERS = (
99     'django.template.loaders.filesystem.Loader',
100     'django.template.loaders.app_directories.Loader',
101     # 'django.template.loaders.eggs.Loader',
102 )
103 
104 MIDDLEWARE_CLASSES = (
105     'django.middleware.common.CommonMiddleware',
106     'django.contrib.sessions.middleware.SessionMiddleware',
107     'django.middleware.csrf.CsrfViewMiddleware',
108     'django.contrib.auth.middleware.AuthenticationMiddleware',
109     'django.contrib.messages.middleware.MessageMiddleware',
110     # Uncomment the next line for simple clickjacking protection:
111     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
112 )
113 
114 ROOT_URLCONF = 'wafer.urls'
115 
116 # Python dotted path to the WSGI application used by Django's runserver.
117 WSGI_APPLICATION = 'wafer.wsgi.application'
118 
119 TEMPLATE_DIRS = (
120     # Put strings here, like "/home/html/django_templates" or
121     # "C:/www/django/templates". Always use forward slashes, even on Windows.
122     # Don't forget to use absolute paths, not relative paths.
123 )
124 
125 TEMPLATE_CONTEXT_PROCESSORS = (
126     'django.contrib.auth.context_processors.auth',
127     'django.core.context_processors.debug',
128     'django.core.context_processors.i18n',
129     'django.core.context_processors.media',
130     'django.core.context_processors.static',
131     'django.core.context_processors.tz',
132     'django.contrib.messages.context_processors.messages',
133     'wafer.context_processors.site_info',
134     'wafer.context_processors.navigation_info',
135     'wafer.context_processors.menu_info',
136     'wafer.context_processors.registration_settings',
137 )
138 
139 INSTALLED_APPS = (
140     'django.contrib.auth',
141     'django.contrib.contenttypes',
142     'django.contrib.sessions',
143     'django.contrib.sites',
144     'django.contrib.messages',
145     'django.contrib.staticfiles',
146     'reversion',
147     'django_medusa',
148     'crispy_forms',
149     'django_nose',
150     'markitup',
151     'rest_framework',
152     'easy_select2',
153     'wafer',
154     'wafer.kv',
155     'wafer.registration',
156     'wafer.talks',
157     'wafer.schedule',
158     'wafer.users',
159     'wafer.sponsors',
160     'wafer.pages',
161     'wafer.tickets',
162     'wafer.compare',
163     # Django isn't finding the overridden templates
164     'registration',
165     'django.contrib.admin',
166 )
167 
168 TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
169 
170 # A sample logging configuration. The only tangible logging
171 # performed by this configuration is to send an email to
172 # the site admins on every HTTP 500 error when DEBUG=False.
173 # See http://docs.djangoproject.com/en/dev/topics/logging for
174 # more details on how to customize your logging configuration.
175 LOGGING = {
176     'version': 1,
177     'disable_existing_loggers': False,
178     'filters': {
179         'require_debug_false': {
180             '()': 'django.utils.log.RequireDebugFalse'
181         }
182     },
183     'handlers': {
184         'mail_admins': {
185             'level': 'ERROR',
186             'filters': ['require_debug_false'],
187             'class': 'django.utils.log.AdminEmailHandler'
188         }
189     },
190     'loggers': {
191         'django.request': {
192             'handlers': ['mail_admins'],
193             'level': 'ERROR',
194             'propagate': True,
195         },
196     }
197 }
198 
199 # Django registration:
200 ACCOUNT_ACTIVATION_DAYS = 7
201 
202 AUTH_USER_MODEL = 'auth.User'
203 
204 # Forms:
205 CRISPY_TEMPLATE_PACK = 'bootstrap3'
206 
207 # Wafer cache settings
208 # We assume that the WAFER_CACHE is cross-process
209 WAFER_CACHE = 'wafer_cache'
210 CACHES = {
211     'default': {
212         'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
213     },
214     WAFER_CACHE: {
215         'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
216         'LOCATION': 'wafer_cache_table',
217     },
218 }
219 
220 
221 # Wafer menu settings
222 
223 WAFER_MENUS = ()
224 # Example menus entries:
225 #
226 #    {"label": _("Home"),
227 #     "url": '/'},
228 #    {"menu": "sponsors",
229 #     "label": _("Sponsors"),
230 #     "items": [
231 #         {"name": "sponsors", "label": _("Our sponsors"),
232 #          "url": reverse_lazy("wafer_sponsors")},
233 #         {"name": "packages", "label": _("Sponsorship packages"),
234 #          "url": reverse_lazy("wafer_sponsorship_packages")},
235 #     ]},
236 #    {"label": _("Talks"),
237 #     "url": reverse_lazy("wafer_users_talks")},
238 
239 WAFER_DYNAMIC_MENUS = (
240     'wafer.pages.models.page_menus',
241 )
242 
243 # Enabled SSO mechanims:
244 WAFER_SSO = (
245     # 'github',
246     # 'debian',
247 )
248 
249 # Log in with GitHub:
250 # WAFER_GITHUB_CLIENT_ID = 'register on github'
251 # WAFER_GITHUB_CLIENT_SECRET = 'to get these secrets'
252 
253 # Log in with Debian SSO:
254 # Requires some Apache config:
255 # SSLCACertificateFile /srv/sso.debian.org/etc/debsso.crt
256 # SSLCARevocationCheck chain
257 # SSLCARevocationFile /srv/sso.debian.org/etc/debsso.crl
258 # <Location /accounts/debian-login/>
259 #     SSLOptions +StdEnvVars
260 #     SSLVerifyClient optional
261 # </Location>
262 # WAFER_DEBIAN_NM_API_KEY = 'obtain one from https://nm.debian.org/apikeys/'
263 
264 # Set this to true to disable the login button on the navigation toolbar
265 WAFER_HIDE_LOGIN = False
266 
267 # Talk submissions open
268 # Set this to False to disable talk submissions
269 WAFER_TALKS_OPEN = True
270 
271 # The form used for talk submission
272 WAFER_TALK_FORM = 'wafer.talks.forms.TalkForm'
273 
274 # Set this to False to disable registration
275 WAFER_REGISTRATION_OPEN = True
276 # Can be 'ticket' for Quicket tickets or 'form' for a classic form
277 WAFER_REGISTRATION_MODE = 'ticket'
278 
279 # For REGISTRATION_MODE == 'form', the form to present
280 WAFER_REGISTRATION_FORM = 'wafer.users.forms.ExampleRegistrationForm'
281 
282 # Allow registered and anonymous users to see registered users
283 WAFER_PUBLIC_ATTENDEE_LIST = True
284 
285 # Ticket registration with Quicket
286 # WAFER_TICKET_SECRET = "i'm a shared secret"
287 
288 # django_medusa -- disk-based renderer
289 MEDUSA_RENDERER_CLASS = "wafer.management.static.WaferDiskStaticSiteRenderer"
290 MEDUSA_DEPLOY_DIR = os.path.join(project_root, 'static_mirror')
291 MARKITUP_FILTER = ('markdown.markdown', {'safe_mode': True})
292 
293 REST_FRAMEWORK = {
294     'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAdminUser',),
295     'PAGE_SIZE': 50
296 }
297
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/wafer/settings.py b/wafer/settings.py
--- a/wafer/settings.py
+++ b/wafer/settings.py
@@ -107,6 +107,7 @@
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
+    'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
     # Uncomment the next line for simple clickjacking protection:
     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 )
@@ -143,6 +144,7 @@
     'django.contrib.sites',
     'django.contrib.messages',
     'django.contrib.staticfiles',
+    'django.contrib.redirects',
     'reversion',
     'django_medusa',
     'crispy_forms',

{"golden_diff": "diff --git a/wafer/settings.py b/wafer/settings.py\n--- a/wafer/settings.py\n+++ b/wafer/settings.py\n@@ -107,6 +107,7 @@\n     'django.middleware.csrf.CsrfViewMiddleware',\n     'django.contrib.auth.middleware.AuthenticationMiddleware',\n     'django.contrib.messages.middleware.MessageMiddleware',\n+    'django.contrib.redirects.middleware.RedirectFallbackMiddleware',\n     # Uncomment the next line for simple clickjacking protection:\n     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',\n )\n@@ -143,6 +144,7 @@\n     'django.contrib.sites',\n     'django.contrib.messages',\n     'django.contrib.staticfiles',\n+    'django.contrib.redirects',\n     'reversion',\n     'django_medusa',\n     'crispy_forms',\n", "issue": "Add support for Django's redirect app to wafer\nIt's useful to be able to add a redirect if a page is moved to a different point in the hierachy.\n\nDjango's already got support for this, so we should leverage that.\n\nThe potentially problematic part is how this iteracts with the static site generation, as django-medusa's handling of redirects is far from ideal.\n\n", "before_files": [{"content": "import os\n\nfrom django.utils.translation import ugettext_lazy as _\n\ntry:\n    from localsettings import *\nexcept ImportError:\n    pass\n\n# Django settings for wafer project.\n\nADMINS = (\n    # The logging config below mails admins\n    # ('Your Name', 'your_email@example.com'),\n)\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': 'wafer.db',\n    }\n}\n\nif os.environ.get('TESTDB', None) == 'postgres':\n    DATABASES['default'].update({\n        'ENGINE': 'django.db.backends.postgresql_psycopg2',\n        'USER': 'postgres',\n        'NAME': 'wafer',\n        })\n\n# Hosts/domain names that are valid for this site; required if DEBUG is False\n# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts\nALLOWED_HOSTS = []\n\n# Local time zone for this installation. Choices can be found here:\n# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name\n# although not all choices may be available on all operating systems.\n# In a Windows environment this must be set to your system time zone.\nTIME_ZONE = 'UTC'\n\n# Language code for this installation. All choices can be found here:\n# http://www.i18nguy.com/unicode/language-identifiers.html\nLANGUAGE_CODE = 'en-us'\n\nSITE_ID = 1\n\n# If you set this to False, Django will make some optimizations so as not\n# to load the internationalization machinery.\nUSE_I18N = True\n\n# If you set this to False, Django will not format dates, numbers and\n# calendars according to the current locale.\nUSE_L10N = True\n\n# If you set this to False, Django will not use timezone-aware datetimes.\nUSE_TZ = True\n\n# Absolute filesystem path to the directory that will hold user-uploaded files.\n# Example: \"/var/www/example.com/media/\"\nproject_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))\nMEDIA_ROOT = os.path.join(project_root, 'media')\n\n# URL that handles the media served from MEDIA_ROOT. Make sure to use a\n# trailing slash.\n# Examples: \"http://example.com/media/\", \"http://media.example.com/\"\nMEDIA_URL = '/media/'\n\n# Absolute path to the directory static files should be collected to.\n# Don't put anything in this directory yourself; store your static files\n# in apps' \"static/\" subdirectories and in STATICFILES_DIRS.\n# Example: \"/var/www/example.com/static/\"\nSTATIC_ROOT = ''\n\n# URL prefix for static files.\n# Example: \"http://example.com/static/\", \"http://static.example.com/\"\nSTATIC_URL = '/static/'\n\n# Additional locations of static files\nSTATICFILES_DIRS = (\n    # Put strings here, like \"/home/html/static\" or \"C:/www/django/static\".\n    # Always use forward slashes, even on Windows.\n    # Don't forget to use absolute paths, not relative paths.\n    os.path.join(project_root, 'bower_components'),\n)\n\n# List of finder classes that know how to find static files in\n# various locations.\nSTATICFILES_FINDERS = (\n    'django.contrib.staticfiles.finders.FileSystemFinder',\n    'django.contrib.staticfiles.finders.AppDirectoriesFinder',\n    # 'django.contrib.staticfiles.finders.DefaultStorageFinder',\n)\n\n# Make this unique, and don't share it with anybody.\nSECRET_KEY = '8iysa30^no&oi5kv$k1w)#gsxzrylr-h6%)loz71expnbf7z%)'\n\n# List of callables that know how to import templates from various sources.\nTEMPLATE_LOADERS = (\n    'django.template.loaders.filesystem.Loader',\n    'django.template.loaders.app_directories.Loader',\n    # 'django.template.loaders.eggs.Loader',\n)\n\nMIDDLEWARE_CLASSES = (\n    'django.middleware.common.CommonMiddleware',\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    # Uncomment the next line for simple clickjacking protection:\n    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',\n)\n\nROOT_URLCONF = 'wafer.urls'\n\n# Python dotted path to the WSGI application used by Django's runserver.\nWSGI_APPLICATION = 'wafer.wsgi.application'\n\nTEMPLATE_DIRS = (\n    # Put strings here, like \"/home/html/django_templates\" or\n    # \"C:/www/django/templates\". Always use forward slashes, even on Windows.\n    # Don't forget to use absolute paths, not relative paths.\n)\n\nTEMPLATE_CONTEXT_PROCESSORS = (\n    'django.contrib.auth.context_processors.auth',\n    'django.core.context_processors.debug',\n    'django.core.context_processors.i18n',\n    'django.core.context_processors.media',\n    'django.core.context_processors.static',\n    'django.core.context_processors.tz',\n    'django.contrib.messages.context_processors.messages',\n    'wafer.context_processors.site_info',\n    'wafer.context_processors.navigation_info',\n    'wafer.context_processors.menu_info',\n    'wafer.context_processors.registration_settings',\n)\n\nINSTALLED_APPS = (\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.sites',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'reversion',\n    'django_medusa',\n    'crispy_forms',\n    'django_nose',\n    'markitup',\n    'rest_framework',\n    'easy_select2',\n    'wafer',\n    'wafer.kv',\n    'wafer.registration',\n    'wafer.talks',\n    'wafer.schedule',\n    'wafer.users',\n    'wafer.sponsors',\n    'wafer.pages',\n    'wafer.tickets',\n    'wafer.compare',\n    # Django isn't finding the overridden templates\n    'registration',\n    'django.contrib.admin',\n)\n\nTEST_RUNNER = 'django_nose.NoseTestSuiteRunner'\n\n# A sample logging configuration. The only tangible logging\n# performed by this configuration is to send an email to\n# the site admins on every HTTP 500 error when DEBUG=False.\n# See http://docs.djangoproject.com/en/dev/topics/logging for\n# more details on how to customize your logging configuration.\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': False,\n    'filters': {\n        'require_debug_false': {\n            '()': 'django.utils.log.RequireDebugFalse'\n        }\n    },\n    'handlers': {\n        'mail_admins': {\n            'level': 'ERROR',\n            'filters': ['require_debug_false'],\n            'class': 'django.utils.log.AdminEmailHandler'\n        }\n    },\n    'loggers': {\n        'django.request': {\n            'handlers': ['mail_admins'],\n            'level': 'ERROR',\n            'propagate': True,\n        },\n    }\n}\n\n# Django registration:\nACCOUNT_ACTIVATION_DAYS = 7\n\nAUTH_USER_MODEL = 'auth.User'\n\n# Forms:\nCRISPY_TEMPLATE_PACK = 'bootstrap3'\n\n# Wafer cache settings\n# We assume that the WAFER_CACHE is cross-process\nWAFER_CACHE = 'wafer_cache'\nCACHES = {\n    'default': {\n        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',\n    },\n    WAFER_CACHE: {\n        'BACKEND': 'django.core.cache.backends.db.DatabaseCache',\n        'LOCATION': 'wafer_cache_table',\n    },\n}\n\n\n# Wafer menu settings\n\nWAFER_MENUS = ()\n# Example menus entries:\n#\n#    {\"label\": _(\"Home\"),\n#     \"url\": '/'},\n#    {\"menu\": \"sponsors\",\n#     \"label\": _(\"Sponsors\"),\n#     \"items\": [\n#         {\"name\": \"sponsors\", \"label\": _(\"Our sponsors\"),\n#          \"url\": reverse_lazy(\"wafer_sponsors\")},\n#         {\"name\": \"packages\", \"label\": _(\"Sponsorship packages\"),\n#          \"url\": reverse_lazy(\"wafer_sponsorship_packages\")},\n#     ]},\n#    {\"label\": _(\"Talks\"),\n#     \"url\": reverse_lazy(\"wafer_users_talks\")},\n\nWAFER_DYNAMIC_MENUS = (\n    'wafer.pages.models.page_menus',\n)\n\n# Enabled SSO mechanims:\nWAFER_SSO = (\n    # 'github',\n    # 'debian',\n)\n\n# Log in with GitHub:\n# WAFER_GITHUB_CLIENT_ID = 'register on github'\n# WAFER_GITHUB_CLIENT_SECRET = 'to get these secrets'\n\n# Log in with Debian SSO:\n# Requires some Apache config:\n# SSLCACertificateFile /srv/sso.debian.org/etc/debsso.crt\n# SSLCARevocationCheck chain\n# SSLCARevocationFile /srv/sso.debian.org/etc/debsso.crl\n# <Location /accounts/debian-login/>\n#     SSLOptions +StdEnvVars\n#     SSLVerifyClient optional\n# </Location>\n# WAFER_DEBIAN_NM_API_KEY = 'obtain one from https://nm.debian.org/apikeys/'\n\n# Set this to true to disable the login button on the navigation toolbar\nWAFER_HIDE_LOGIN = False\n\n# Talk submissions open\n# Set this to False to disable talk submissions\nWAFER_TALKS_OPEN = True\n\n# The form used for talk submission\nWAFER_TALK_FORM = 'wafer.talks.forms.TalkForm'\n\n# Set this to False to disable registration\nWAFER_REGISTRATION_OPEN = True\n# Can be 'ticket' for Quicket tickets or 'form' for a classic form\nWAFER_REGISTRATION_MODE = 'ticket'\n\n# For REGISTRATION_MODE == 'form', the form to present\nWAFER_REGISTRATION_FORM = 'wafer.users.forms.ExampleRegistrationForm'\n\n# Allow registered and anonymous users to see registered users\nWAFER_PUBLIC_ATTENDEE_LIST = True\n\n# Ticket registration with Quicket\n# WAFER_TICKET_SECRET = \"i'm a shared secret\"\n\n# django_medusa -- disk-based renderer\nMEDUSA_RENDERER_CLASS = \"wafer.management.static.WaferDiskStaticSiteRenderer\"\nMEDUSA_DEPLOY_DIR = os.path.join(project_root, 'static_mirror')\nMARKITUP_FILTER = ('markdown.markdown', {'safe_mode': True})\n\nREST_FRAMEWORK = {\n    'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAdminUser',),\n    'PAGE_SIZE': 50\n}\n", "path": "wafer/settings.py"}], "after_files": [{"content": "import os\n\nfrom django.utils.translation import ugettext_lazy as _\n\ntry:\n    from localsettings import *\nexcept ImportError:\n    pass\n\n# Django settings for wafer project.\n\nADMINS = (\n    # The logging config below mails admins\n    # ('Your Name', 'your_email@example.com'),\n)\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': 'wafer.db',\n    }\n}\n\nif os.environ.get('TESTDB', None) == 'postgres':\n    DATABASES['default'].update({\n        'ENGINE': 'django.db.backends.postgresql_psycopg2',\n        'USER': 'postgres',\n        'NAME': 'wafer',\n        })\n\n# Hosts/domain names that are valid for this site; required if DEBUG is False\n# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts\nALLOWED_HOSTS = []\n\n# Local time zone for this installation. Choices can be found here:\n# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name\n# although not all choices may be available on all operating systems.\n# In a Windows environment this must be set to your system time zone.\nTIME_ZONE = 'UTC'\n\n# Language code for this installation. All choices can be found here:\n# http://www.i18nguy.com/unicode/language-identifiers.html\nLANGUAGE_CODE = 'en-us'\n\nSITE_ID = 1\n\n# If you set this to False, Django will make some optimizations so as not\n# to load the internationalization machinery.\nUSE_I18N = True\n\n# If you set this to False, Django will not format dates, numbers and\n# calendars according to the current locale.\nUSE_L10N = True\n\n# If you set this to False, Django will not use timezone-aware datetimes.\nUSE_TZ = True\n\n# Absolute filesystem path to the directory that will hold user-uploaded files.\n# Example: \"/var/www/example.com/media/\"\nproject_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))\nMEDIA_ROOT = os.path.join(project_root, 'media')\n\n# URL that handles the media served from MEDIA_ROOT. Make sure to use a\n# trailing slash.\n# Examples: \"http://example.com/media/\", \"http://media.example.com/\"\nMEDIA_URL = '/media/'\n\n# Absolute path to the directory static files should be collected to.\n# Don't put anything in this directory yourself; store your static files\n# in apps' \"static/\" subdirectories and in STATICFILES_DIRS.\n# Example: \"/var/www/example.com/static/\"\nSTATIC_ROOT = ''\n\n# URL prefix for static files.\n# Example: \"http://example.com/static/\", \"http://static.example.com/\"\nSTATIC_URL = '/static/'\n\n# Additional locations of static files\nSTATICFILES_DIRS = (\n    # Put strings here, like \"/home/html/static\" or \"C:/www/django/static\".\n    # Always use forward slashes, even on Windows.\n    # Don't forget to use absolute paths, not relative paths.\n    os.path.join(project_root, 'bower_components'),\n)\n\n# List of finder classes that know how to find static files in\n# various locations.\nSTATICFILES_FINDERS = (\n    'django.contrib.staticfiles.finders.FileSystemFinder',\n    'django.contrib.staticfiles.finders.AppDirectoriesFinder',\n    # 'django.contrib.staticfiles.finders.DefaultStorageFinder',\n)\n\n# Make this unique, and don't share it with anybody.\nSECRET_KEY = '8iysa30^no&oi5kv$k1w)#gsxzrylr-h6%)loz71expnbf7z%)'\n\n# List of callables that know how to import templates from various sources.\nTEMPLATE_LOADERS = (\n    'django.template.loaders.filesystem.Loader',\n    'django.template.loaders.app_directories.Loader',\n    # 'django.template.loaders.eggs.Loader',\n)\n\nMIDDLEWARE_CLASSES = (\n    'django.middleware.common.CommonMiddleware',\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'django.contrib.redirects.middleware.RedirectFallbackMiddleware',\n    # Uncomment the next line for simple clickjacking protection:\n    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',\n)\n\nROOT_URLCONF = 'wafer.urls'\n\n# Python dotted path to the WSGI application used by Django's runserver.\nWSGI_APPLICATION = 'wafer.wsgi.application'\n\nTEMPLATE_DIRS = (\n    # Put strings here, like \"/home/html/django_templates\" or\n    # \"C:/www/django/templates\". Always use forward slashes, even on Windows.\n    # Don't forget to use absolute paths, not relative paths.\n)\n\nTEMPLATE_CONTEXT_PROCESSORS = (\n    'django.contrib.auth.context_processors.auth',\n    'django.core.context_processors.debug',\n    'django.core.context_processors.i18n',\n    'django.core.context_processors.media',\n    'django.core.context_processors.static',\n    'django.core.context_processors.tz',\n    'django.contrib.messages.context_processors.messages',\n    'wafer.context_processors.site_info',\n    'wafer.context_processors.navigation_info',\n    'wafer.context_processors.menu_info',\n    'wafer.context_processors.registration_settings',\n)\n\nINSTALLED_APPS = (\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.sites',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'django.contrib.redirects',\n    'reversion',\n    'django_medusa',\n    'crispy_forms',\n    'django_nose',\n    'markitup',\n    'rest_framework',\n    'easy_select2',\n    'wafer',\n    'wafer.kv',\n    'wafer.registration',\n    'wafer.talks',\n    'wafer.schedule',\n    'wafer.users',\n    'wafer.sponsors',\n    'wafer.pages',\n    'wafer.tickets',\n    'wafer.compare',\n    # Django isn't finding the overridden templates\n    'registration',\n    'django.contrib.admin',\n)\n\nTEST_RUNNER = 'django_nose.NoseTestSuiteRunner'\n\n# A sample logging configuration. The only tangible logging\n# performed by this configuration is to send an email to\n# the site admins on every HTTP 500 error when DEBUG=False.\n# See http://docs.djangoproject.com/en/dev/topics/logging for\n# more details on how to customize your logging configuration.\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': False,\n    'filters': {\n        'require_debug_false': {\n            '()': 'django.utils.log.RequireDebugFalse'\n        }\n    },\n    'handlers': {\n        'mail_admins': {\n            'level': 'ERROR',\n            'filters': ['require_debug_false'],\n            'class': 'django.utils.log.AdminEmailHandler'\n        }\n    },\n    'loggers': {\n        'django.request': {\n            'handlers': ['mail_admins'],\n            'level': 'ERROR',\n            'propagate': True,\n        },\n    }\n}\n\n# Django registration:\nACCOUNT_ACTIVATION_DAYS = 7\n\nAUTH_USER_MODEL = 'auth.User'\n\n# Forms:\nCRISPY_TEMPLATE_PACK = 'bootstrap3'\n\n# Wafer cache settings\n# We assume that the WAFER_CACHE is cross-process\nWAFER_CACHE = 'wafer_cache'\nCACHES = {\n    'default': {\n        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',\n    },\n    WAFER_CACHE: {\n        'BACKEND': 'django.core.cache.backends.db.DatabaseCache',\n        'LOCATION': 'wafer_cache_table',\n    },\n}\n\n\n# Wafer menu settings\n\nWAFER_MENUS = ()\n# Example menus entries:\n#\n#    {\"label\": _(\"Home\"),\n#     \"url\": '/'},\n#    {\"menu\": \"sponsors\",\n#     \"label\": _(\"Sponsors\"),\n#     \"items\": [\n#         {\"name\": \"sponsors\", \"label\": _(\"Our sponsors\"),\n#          \"url\": reverse_lazy(\"wafer_sponsors\")},\n#         {\"name\": \"packages\", \"label\": _(\"Sponsorship packages\"),\n#          \"url\": reverse_lazy(\"wafer_sponsorship_packages\")},\n#     ]},\n#    {\"label\": _(\"Talks\"),\n#     \"url\": reverse_lazy(\"wafer_users_talks\")},\n\nWAFER_DYNAMIC_MENUS = (\n    'wafer.pages.models.page_menus',\n)\n\n# Enabled SSO mechanims:\nWAFER_SSO = (\n    # 'github',\n    # 'debian',\n)\n\n# Log in with GitHub:\n# WAFER_GITHUB_CLIENT_ID = 'register on github'\n# WAFER_GITHUB_CLIENT_SECRET = 'to get these secrets'\n\n# Log in with Debian SSO:\n# Requires some Apache config:\n# SSLCACertificateFile /srv/sso.debian.org/etc/debsso.crt\n# SSLCARevocationCheck chain\n# SSLCARevocationFile /srv/sso.debian.org/etc/debsso.crl\n# <Location /accounts/debian-login/>\n#     SSLOptions +StdEnvVars\n#     SSLVerifyClient optional\n# </Location>\n# WAFER_DEBIAN_NM_API_KEY = 'obtain one from https://nm.debian.org/apikeys/'\n\n# Set this to true to disable the login button on the navigation toolbar\nWAFER_HIDE_LOGIN = False\n\n# Talk submissions open\n# Set this to False to disable talk submissions\nWAFER_TALKS_OPEN = True\n\n# The form used for talk submission\nWAFER_TALK_FORM = 'wafer.talks.forms.TalkForm'\n\n# Set this to False to disable registration\nWAFER_REGISTRATION_OPEN = True\n# Can be 'ticket' for Quicket tickets or 'form' for a classic form\nWAFER_REGISTRATION_MODE = 'ticket'\n\n# For REGISTRATION_MODE == 'form', the form to present\nWAFER_REGISTRATION_FORM = 'wafer.users.forms.ExampleRegistrationForm'\n\n# Allow registered and anonymous users to see registered users\nWAFER_PUBLIC_ATTENDEE_LIST = True\n\n# Ticket registration with Quicket\n# WAFER_TICKET_SECRET = \"i'm a shared secret\"\n\n# django_medusa -- disk-based renderer\nMEDUSA_RENDERER_CLASS = \"wafer.management.static.WaferDiskStaticSiteRenderer\"\nMEDUSA_DEPLOY_DIR = os.path.join(project_root, 'static_mirror')\nMARKITUP_FILTER = ('markdown.markdown', {'safe_mode': True})\n\nREST_FRAMEWORK = {\n    'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAdminUser',),\n    'PAGE_SIZE': 50\n}\n", "path": "wafer/settings.py"}]}