remove unnecessary imports
[mygpo.git] / mygpo / security.py
blob1fa784dc50fed7f20b76f22bb02eb7e431921d58
1 # -*- coding: utf-8 -*-
3 # This file is part of my.gpodder.org.
5 # my.gpodder.org is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or (at your
8 # option) any later version.
10 # my.gpodder.org is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
13 # License for more details.
15 # You should have received a copy of the GNU Affero General Public License
16 # along with my.gpodder.org. If not, see <http://www.gnu.org/licenses/>.
19 from django.shortcuts import render_to_response
20 from django.template import RequestContext
21 from django.contrib.sites.models import Site
22 from django.utils.translation import ugettext as _
24 def csrf_failure(request, reason=""):
25 site = Site.objects.get_current()
26 return render_to_response('csrf.html', {
27 'site': site,
28 'method': request.method,
29 'referer': request.META.get('HTTP_REFERER', _('another site')),
30 'path': request.path,
31 'get': request.GET,
32 'post': request.POST,
33 }, context_instance=RequestContext(request))