Open oldani opened 7 years ago
Essentially the views should have a condition for "Content-Type: application/json" and reply with the appropriate format, either json or html. Maybe we could add a configuration flag, so developers can control the behaviour.
I need this in different projects, too, and might implement it, if it has the chance to get merged. @lingthio I am interested in your opinion on the matter.
I would like to know more about which views are going to be affected, as well as an example of just one of the view, so I can assess the risk/reward ratio of a complete pull request. Thanks!
So, i started using Flask User around a week ago, i wrote a custom adapter for the Db im using and do some customization, everything haa go nice, the package is great, but then i want to move some of the login to the client using React for a better UI/UX, since i could do a post request to any of the endpoints, the problems comes with the response, all the views handlers make use of flash messages and redirects which may it's no what some want when buildidng client site components.
It's that i could wrote my own views, but i may be a lot's work beacues i literally will have to rewrote almost all the package. Rather than i think that the package could include this, may split in more modules the views or verify if a "aplication/json" in headers and make a json response.
This features would be very nice for this package, if could i would like to work on this cause will be very helpful in my concern.