Django Rest Framework custom api.html throws warnings on OPTIONS request ajax form #9039
Unanswered
salicius
asked this question in
Question & Answer
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm building my custom
api.html
template for Django Rest Framework api project (based on the officialbase.html
template to customize mine), but I'm facing some issues implementing the OPTIONS button. Here it is my code:I created the OPTIONS button like in the original template base.html and in the end of the body I loaded js functions without them the button function not works properly.
In fact, if clicked it shows the drf option content but unfortunately it will throw warnings and errors, like if it replace entire html page but keeping old elements and after click shows inside the console:
Seems like the ajax call is causing all this troubles, but I just created functions, copied from the official repo branch files (load-ajax-form.js, ajax-form.js, csrf.js) and put them inside my
static/rest_framework/js
folder.Where I'm wrong on customize the template ?
Beta Was this translation helpful? Give feedback.
All reactions