How to deploy a server script?

What is the best way to deploy python Flask web application in a web server under ubuntu and what web server do you recommend?

  • I usually deploy my python app in GAE but a client wishes to deploy on their ubuntu server. Any good tutorials on deploying? Thank you in advanced

  • Answer:

    The Flask documentation has some great information on how to deploy using Fabric. I started with its suggestions and deployment has been a breeze. I've been running on apache but mostly because I have experience with it--I don't know the pros and cons of it vs nginx and others. http://flask.pocoo.org/docs/deploying/#deployment http://flask.pocoo.org/docs/patterns/fabric/

Paul Hemberger at Quora Visit the source

Was this solution helpful to you?

Other answers

http://docs.fabfile.org/ is your friend. If you're used to GAE's push-button-deployment process, you can achieve the same using Flask. Fabric is essentially an alternative to writing shell scripts so you would write a deployment script that would, for example: 1. run tests on your local machine 2. ssh to remote server 3. backup current version of app 4. pull from git 5. pip install requirements 6. restart your wsgi server (apache, gunicorn etc) 7. restart your static files server (nginx) You can stick this in a single Fabric action and deploy like this: # fab deploy_dev

Giv Parvaneh

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.