python-3.xflaskweb-applications

Running flask application without command prompt


I have been developing a dashboard based on the Python Flask. I am in the verge of my work. After completing my work, I don't know how to host my flask application in the production server. To be clear, I want my user need not to run the flask application in command prompt, then type the URL in the browser to see the dashboard. I want users of the dashboard have to type the URL only in the browser to see the dashboard.


Solution

  • It's important for you to know the basics of flask. It's is a framework to serve web applications. So, you need to host a web application...

    You can host it on your lan network or you can host it on a dedicated server on the web. You can use heroku(https://devcenter.heroku.com/articles/getting-started-with-python) to host your app for free (he free plan has a lot of limitations). Heroku has support for some RDMS like postgres. Note that heroku free plan is not supposed to be used as a production server!

    I suppose that you've been using the embbed flask server(dev server) that is NOT production ready, for that you should probably be looking to use gunicorn or some wsgi server.

    If you want to deploy to your client's server you usually use a reverse proxy(NGINX,Apache2), a WSGI server(GUNICORN,uWSGI...) with your app behind it and some more. But if you do not know what you are doing, maybe you need to talk to a sysadmin, since you'll need to manage the server.

    Check this guide on how to do it.

    hope it helps!