django_example_ynh/django_ynh/views.py
JensDiemer f578f144a3 init
2020-12-23 19:58:33 +01:00

15 lines
387 B
Python

import pprint
from django.http import HttpResponse
from django.shortcuts import redirect
def request_media_debug_view(request):
""" debug request.META """
if not request.user.is_authenticated:
return redirect('admin:index')
meta = pprint.pformat(request.META)
html = f'<html><body>request.META: <pre>{meta}</pre></body></html>'
return HttpResponse(html)