[Answered ]-Django REST Framework – Tutorial – Confused

2👍

OPTIONS method

The OPTIONS method allows a client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.
— RFC7231, Section 4.3.7.

If you want the JS to have the meta information on that resource, you may want to implement a OPTIONS method, have the JS process the meta data returned, and then adjust the form for creating a new instance.

If you follow the above-linked documentation for Django REST Framework, you’ll be able to customize what’s returned in the meta data to fit your needs.

👤bakkal

0👍

I do not know, why django restframework is so confusing and complicated. I have made several Apis in other frameworks and had better control over them. But here I have to read the documentation a lot to understand but still not clear.For instance, see laravel Api framework,it is so handy and secure everything is cooked, therefore we do not have to think a lot for settings, importing etc, just have to focus on business logic and API response format.

Leave a comment