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 | python

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

    Installing Django on Abstract Deep Hosting

    Suppose that only Python is installed on the hosting, but there is neither Django nor Virtualenv, and also you do not have superuser rights in order to fix this situation. Your task is to create a project in Django and make sure that everything works.

    # установить
    python -murllib | python - --no-site-packages p
    ./p/bin/pip install django==1.2.4
    # убедиться
    . ./p/bin/activate startproject example
    python example/ runserver

    Installing Django in Deep Wine

    Let's say that you got stoned with mans , you want to check the operability of your project on Django under windows wine.

    # Важно: необходимо выбрать установку "For all users"
    msiexec /i python-2.6.6.msi
    wine C:/python26/python.exe -murllib | wine C:/python26/python.exe - w
    ./w/Scripts/pip.exe django
    ./w/Scripts/python.exe ./w/Scripts/ startproject example
    ./w/Scripts/python.exe example/ runserver

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

    How does it work

    See for yourself - this is hosted on GitHub .

    Also popular now: