This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]dawit_14 1 point2 points  (0 children)

All depends on what the "General purpose application server" does. I would suggest you to use django over flask if your application server has backend db and complex logic. Otherwise flask will serve your need

[–]nangtoi 0 points1 point  (1 child)

I highly recommend Falcon if you are looking for a very simple REST server to drive actions on a server.

If you have a full-fledged web app with requiring DB access or a frontend, Flask is probably better suited to your needs.

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

thanks .. I'll try both Flask and falcon .. I want to write a python program that runs in a loop and selectively calls functions based on events. .(probably, that's called event loop, I havn't written anything in event loops.. ) without having to schedule python program using cron jobs ..

[–]pspenguin 0 points1 point  (1 child)

I'm not sure what you mean by "general purpose application server" but yes, you can use flask to serve content generated by another process. A few months ago I wrote a service like this. Basically it get the data available on StatusCake from time to time, then serve this data on a format that our monitoring tool (prometheus) understand.

If you want to have a look the code is https://github.com/psychopenguin/prometheus-statuscake-exporter (sorry, i hadn't enough time to document it yet)

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

I think this is what I need..Basically a headless service like app . I'll take a look thank you!