Commit dad70c5a by Piotr Mitros

Proper from addresses, static view allows CSRF

parent 55c10212
...@@ -7,8 +7,8 @@ if not COURSEWARE_ENABLED: ...@@ -7,8 +7,8 @@ if not COURSEWARE_ENABLED:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
SITE_NAME = "localhost:8000" SITE_NAME = "localhost:8000"
DEFAULT_FROM_EMAIL = 'nobody@localhost' DEFAULT_FROM_EMAIL = 'registration@mitx.mit.edu'
DEFAULT_FEEDBACK_EMAIL = 'nobody@localhost' DEFAULT_FEEDBACK_EMAIL = 'feedback@mitx.mit.edu'
WIKI_REQUIRE_LOGIN_EDIT = True WIKI_REQUIRE_LOGIN_EDIT = True
WIKI_REQUIRE_LOGIN_VIEW = True WIKI_REQUIRE_LOGIN_VIEW = True
......
...@@ -6,11 +6,16 @@ ...@@ -6,11 +6,16 @@
from djangomako.shortcuts import render_to_response, render_to_string from djangomako.shortcuts import render_to_response, render_to_string
from django.shortcuts import redirect from django.shortcuts import redirect
valid_templates=['index.html', 'staff.html', 'info.html', 'credits.html'] from auth.views import csrf
#valid_templates=['index.html', 'staff.html', 'info.html', 'credits.html']
valid_templates=['mitx.html', 'index.html', 'courseinfo.html']
def index(request, template): def index(request, template):
csrf_token = csrf(request)['csrf_token']
if template in valid_templates: if template in valid_templates:
return render_to_response(template,{}) return render_to_response(template,{'error' : '',
'csrf': csrf_token})
else: else:
return redirect('/') return redirect('/')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment