Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to migrate a python site to another machine?

I would like to know how to setup a complex python website, that is currently running in production environment, into a local machine for development?

Currently the site uses python combined with Django apps (registration + cms modules) in a virtual environment.

like image 382
ipegasus Avatar asked Apr 26 '12 21:04

ipegasus


1 Answers

In case you are using pip for package management, you can easily recreate the virtualenv on another system:

On system1, run pip freeze --local > requirements.txt and copy that file to system2. Over there, create and activate the virtualenv and use pip install -r requirements.txt to install all packages that were installed in the previous virtualenv.

Your python code can be simply copied to the new system; I'd find -name '*.pyc' -delete though since you usually do not want to move compiled code (even if it's just python bytecode) between machines.

like image 94
ThiefMaster Avatar answered Oct 22 '22 10:10

ThiefMaster