1👍
Make sure that if you are submitting a form you {%csrf_token%}
as a hidden input in your form.
Also, check to make sure that CsrfViewMiddleware
is in your MIDDLEWARE_CLASSES
in settings.py
0👍
If this view is not for a form but to be accessed directly by something you can remove csrf checks with csrf_exempt
decorator :
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^test/src/(\d+)', csrf_exempt(MyView.as_view()), name='put_'),
]
- Issue with Django URL Mapping/DetailView
- For a Charfield with choices, how to use the human readable name in list_display through a foreignkey?
- Python error parsing json
- Dynamic database selection based on URL in Django
Source:stackexchange.com