You are seeing this message because this HTTPS site requires a “Referer header” to be sent by your Web browser, but none was sent. This header is required for security reasons, to ensure that your browser is not being hijacked by third parties.
If you have configured your browser to disable “Referer” headers, please re-enable them, at least for this site, or for HTTPS connections, or for “same-origin” requests.
If you are using the <meta name="referrer" content="no-referrer"> tag or including the “Referrer-Policy: no-referrer” header, please remove them. The CSRF protection requires the “Referer” header to do strict referer checking. If you’re concerned about privacy, use alternatives like <a rel="noreferrer" …> for links to third-party sites.
Reason given for failure:
Referer checking failed - no Referer.
...
[View.py]
class TslIdDownFormView(TemplateView):template_name = 'blog/iddown.html'checklist = []@csrf_exemptdef post(self, request, *args, **kwargs):checklist = request.POST.getlist('selection')return render(request, self.template_name, {'checklist': checklist})
[url.py]url_pattern = [
...
path('iddown', TslIdDownFormView.as_view(), name='iddown'), ...
]
[Template.html]<form action="{% url 'iddown' %}" method="post" id="post_form" target="print_popup"onsubmit="window.open('about:blank', 'print_popup', 'width=325,height=520');" >{% csrf_token %}<input type="submit" class="iddown btn btn-outline btn-primary pull-right" id="selectBtn" value="Download" ></form>