Django Rest Framework - Browsable API Form always

2019-07-17 03:58发布

I'm having an issue where my api, which uses a very vanilla django-rest-framework setup (viewsets and model serializers) is working fine locally, and once deployed, works fine for everything but POSTing via the HTML form in the browsable API. Any time I submit a post via this form, I get "HTTP 400 bad request".

Has anybody experienced anything similar? I'm running NGINX/UWSGI on a centos server.

2条回答
走好不送
2楼-- · 2019-07-17 04:18

I had the Exact same problem as you. What worked for me was downgrading Rest framework from version 3.3.0 to version 3.2.5 . I have no idea why this worked but I hope this helps you too

查看更多
不美不萌又怎样
3楼-- · 2019-07-17 04:29

This sounds like a regression. There's already a bug opened for this: https://github.com/tomchristie/django-rest-framework/issues/3588

查看更多
登录 后发表回答