Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy a python webapp with dependencies using virtualenv?

I'm looking for a way to automate deployment of web applications written in Python to a server. I would like to use virtualenv to have a clean environment for this application.

However, I am wondering how to manage dependencies when deploying to the server ?

In development, I have a virtualenv in which I install external libraries using pip, so I am looking for a way to automatically install those dependencies in production ?

Thank you for your time

like image 678
damienfir Avatar asked Jul 09 '10 08:07

damienfir


1 Answers

With pip you can create a requirements file:

$ pip freeze > requirements.txt

Then in the server to install all of these you do:

$ pip install -r requirements.txt

And with this (if the server has everything necessary to build the binary packages that you might have included) all is ready.

like image 193
diegogs Avatar answered Oct 26 '22 09:10

diegogs