Proper from addresses, static view allows CSRF
This commit is contained in:
@@ -7,8 +7,8 @@ if not COURSEWARE_ENABLED:
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||
SITE_NAME = "localhost:8000"
|
||||
|
||||
DEFAULT_FROM_EMAIL = 'nobody@localhost'
|
||||
DEFAULT_FEEDBACK_EMAIL = 'nobody@localhost'
|
||||
DEFAULT_FROM_EMAIL = 'registration@mitx.mit.edu'
|
||||
DEFAULT_FEEDBACK_EMAIL = 'feedback@mitx.mit.edu'
|
||||
|
||||
WIKI_REQUIRE_LOGIN_EDIT = True
|
||||
WIKI_REQUIRE_LOGIN_VIEW = True
|
||||
|
||||
@@ -6,11 +6,16 @@
|
||||
from djangomako.shortcuts import render_to_response, render_to_string
|
||||
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):
|
||||
csrf_token = csrf(request)['csrf_token']
|
||||
if template in valid_templates:
|
||||
return render_to_response(template,{})
|
||||
return render_to_response(template,{'error' : '',
|
||||
'csrf': csrf_token})
|
||||
else:
|
||||
return redirect('/')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user