[Answer]-Django post with data returns a HTTP 403 forbidden error

1👍

Are you hitting a CSRF error? You’ll want to add the csrf_exempt decorator to your view.

👤Tom

0👍

Based on your urls.py you should actually get 404 for this url /api/recipes/item_new
Also, your resource is named recipes so your first and second urls are exact, which means the second will never get called.

url(r'^api/', include(recipe_resource.urls)),
url(r'^api/recipes/$', views.item_new()),

Try swithcing the order here and adjust your item_new url like below

url(r'^api/recipes/item_new$', views.item_new()),
url(r'^api/', include(recipe_resource.urls)),

Leave a comment