Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Jacopo Scrinzi
16,668 PointsHow to deploy a Flask App
Hi there,
I'm building a Flask app and I'd like to deploy it to production server. Here in Treehouse we always run the application via terminal using flask as HTTP server. I did a little but of research and i saw a lot of people using Apache with wsgi module. What is the best way to put my application in production?
Cheers
Edit:
found a working solution. I'm using UWSGI + Virtualenv + NGINX. I have a service that use uwsgi to run the application and creates a socket then I point NGINX to the socket. Here is a guide how to do it: https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-14-04
2 Answers

Jacopo Scrinzi
16,668 PointsHeroku is not really what I was looking for. I need to deploy it on an Ubuntu server where I have already other stuff on it. I saw you can use guinicorn and nginx but I was wondering what was the best option. Any tips?

Shane Kercheval
2,036 Pointsdid you ever figure this out? I'm looking for the same thing.

Jacopo Scrinzi
16,668 PointsYes, found a working solution. I'm using UWSGI + Virtualenv + NGINX. I have a service that use uwsgi to run the application and creates a socket then I point NGINX to the socket. Here is a guide how to do it: https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-14-04

igsm '
10,440 Pointshttps://www.youtube.com/watch?v=pmRT8QQLIqk Guy does a good job in 4 minutes to deploy a simple Flask app on Heroku (if you already have an account and venv).
Dylan Shine
17,565 PointsDylan Shine
17,565 PointsThis article will help you deploy your flask app to heroku.
http://virantha.com/2013/11/14/starting-a-simple-flask-app-with-heroku/