django - how to use django_csrf for mobile application -
django - how to use django_csrf for mobile application -
i writing mobile application django website. understand every form in django has csrf token key protection. when utilize browser navigate site, server render key user.
what confused mobile application, dont need view presetation layer site. wanna http post send data. know can utilize csrf_exempt
disable csrf form. or can create view render csrf token me, way need parsing , http request. there nicer way it?
thanks time
if mobile app rendering template can add together {% csrf_token %}
template renders form. if you're not using form , instead posting info can create token above , post it's value data. , if you're not using template create mobile app's markup utilize csrf_exempt (if you're posting info server periodically).
obviously there has view process posted data, if you're using generic view still wrap view (in urls.py example) , gain utilize of csrf_exempt
django django-csrf
Comments
Post a Comment