Skip to main content
Help us improve Python packaging – donate today!

Automaticly manages virtualenv for django project

Project Description



Warning: You have to consider where to place this package because it has to
be importable “outside” your project. Probably best place for it exists in project directory (or your “lib” directory) or in system- wide packages’ place.

Simplest way is to do (system-wide):

pip install django-env

or using archive

tar xf django-env* cd django-env* python install

or place installed egg in project’s directory.


Firstly, you have some options in

You can set number of settings:


When doing env_create, should be run env_update after it.


When doing env_create, should it connect global site- packages.

env.settings.DJANGO_ENV_NAME = ‘py_env’

Directory’s name of virtualenv. If the name is relative name it is appended to project’s path, if the name is absolute name (starts with /), is is set as is for virtualenv’s directory.


During env_update it is used pip for installing packages, you can add here additional arguments like -i or -f. -U can be set dynamicaly by adding –upgrade to env_update.

env.settings.DJANGO_ENV_UPDATE_REQUIREMENTS = ‘requirements.pip’

Name of file with requirements. If this path is relative is appended to project’s path, else it is set as absolute.
Note: Project’s directory is the same where and


Note: It is just cosmetic change to display command in help.


INSTALLED_APPS += (‘env’, )

project setup

How to activate the environment? Example:

import env

I suggest to place it in at the top.

How it works?

It just grab control from (if you import it) and check the argument line. If you passed one of django-env commands, it do what is needed and exit; else it pass control to to parse other args.


Target of this project is automating in creating project environment.

This app gives you some additional commands:

env_create [–force]
create environment (and optionally do env_update - it depends on DJANGO_ENV_AUTOUPDATE variable in
env_update [–upgrade]

install packages from DJANGO_ENV_REQUIREMENTS file to current environment via pip install -r, or if you provide –upgrade it runs pip install -U -r.

You can pass other arguments to pip, see

simply deletes environments directory.


  • py_env/last_update - show last update date - monitoring feature



  • easier setup
  • added several options to ‘’
  • it should work!

0.1 - init

Release history Release notifications

This version
History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-env-0.2.1.tar.gz (13.1 kB) Copy SHA256 hash SHA256 Source None Feb 13, 2012

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page