In settings.py
, can add CSRF_FAILURE_VIEW='app_name.views.csrf_failure'
Then add csrf_failure
in your view.
def csrf_failure(request, reason=""):
ctx = {'message': 'custom message'}
return render_to_response(custom_template, ctx)
More details in documentation
'backend > django' 카테고리의 다른 글
Django: filter queryset with m2m - using annotate (0) | 2018.04.28 |
---|---|
Django: overriding admin css in django (0) | 2018.04.27 |
Using Environment variable in uswgi.ini (0) | 2018.04.22 |
django-redis install and basic usage (0) | 2018.04.16 |
Django: get all logged-in users by using session (0) | 2018.04.15 |