A very basic question. I have a FLASK app which has postgresql behind it. There are no ORM for this application. All requests are done via SQL psycopg2 interface.
Now I want to expose certain API's from this application. What would be the best way to proceed.
1> Just like: http://flask-peewee.readthedocs.org/en/latest/rest-api.html 2> or can I do one without the ORM. It seems that ORM for an RESTful API is very useful but in this case I have to have a separate database elements and copy data from the postgres model to the ORM.
any suggestion would be welcome.
I have a similar setup Flask + Postgres and PsycoPG2. I followed the following tutorials to design and implement the API I handle errors manually and respond with the appropriate HTTP code
http://blog.luisrei.com/articles/rest.html { Design API}
http://blog.luisrei.com/articles/flaskrest.html { Implement API}
Looks like Flask-Restless is a better choice. Validations, authentication support are much simpler with it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With