much more pep8
[mygpo.git] / mygpo / web / views / security.py
blobf192ded2fa8d8c36c9c8d13bd33f1cfe9bd91109
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
20 from django.contrib.sites.models import RequestSite
21 from django.utils.translation import ugettext as _
22 from django.views.decorators.cache import never_cache
25 @never_cache
26 def csrf_failure(request, reason=""):
27 site = RequestSite(request)
28 return render(request, 'csrf.html', {
29 'site': site,
30 'method': request.method,
31 'referer': request.META.get('HTTP_REFERER', _('another site')),
32 'path': request.path,
33 'get': request.GET,
34 'post': request.POST,