📜 ⬆️ ⬇️

The easiest way to create a virtualenv environment

In this article I want to tell you about this unique way to create isolated Python environments for convenient and comfortable development even in the most dense conditions.

$ python -murllib http://tiny.cc/ve-setup | python 

So it looks like, and under the cut is a couple of recipes for use.

Installing Django on abstract dense hosting


Suppose that only Python is installed on the hosting, but there is neither Django, nor Virtualenv, and you also do not have superuser rights to correct this situation. Your task is to create a project on Django and make sure that everything works.
')
 #  python -murllib http://tiny.cc/ve-setup | python - --no-site-packages p ./p/bin/pip install django==1.2.4 #  . ./p/bin/activate django-admin.py startproject example python example/manage.py runserver 

Installing Django in Deep Wine


Let's say that you are stoned with mana. You want to test the performance of your project on Django under windows wine.

 wget http://www.python.org/ftp/python/2.6.6/python-2.6.6.msi # :    "For all users" msiexec /i python-2.6.6.msi wine C:/python26/python.exe -murllib http://tiny.cc/ve-setup | wine C:/python26/python.exe - w ./w/Scripts/pip.exe django ./w/Scripts/python.exe ./w/Scripts/django-admin.py startproject example ./w/Scripts/python.exe example/manage.py runserver 

By the way, binary libraries (such as lxml) need to be installed using easy_install.exe, not pip.exe, since the latter only works with sources.

How it works


See for yourself - it is posted on github .

Source: https://habr.com/ru/post/112917/


All Articles