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, 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 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 got stoned with mans , you want to check the operability 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 works only with the sources.

    How does it work


    See for yourself - this is hosted on GitHub .

    Also popular now: