My favorites | Sign in
Project Logo
                
Search
for
Updated Jul 29, 2008 by loren.davie
Labels: Featured, Installation
Installation  
How to install django-environment.

Getting django-environment

django-environment is available as source code only at the moment. Click on the "Source" tab to see the svn url. Follow the instructions there on checking out the source code.

Installing django-environment

Re-usable App Installation

Project specific Installation

Configuring settings.py

  1. Add "environment" to your INSTALLED_APPS.
  2. Add "environment.EnvironmentMiddleware" to MIDDLEWARE_CLASSES. It can probably just go last.
  3. Add a new setting to settings.py: ENVPATH. ENVPATH should be assigned the directory path to where your environment file should live. However the ENVPATH should not include the environment file itself, only the parent directory.

Make an Environment File

Environment files are just python files that end in ".env". They must be placed in the directory specified as the ENVPATH.

django-environment will pick up each .env file found on the ENVPATH and combine them to create the composite environment.

An environment file, at minimum, will contain the following code:

entries = {
    'foo':'bar'
}

The above environment file will create an environment variable called "foo" and assign to it the string "bar".

For more on environment files, see the Environment Files page.

That's it for setup! From here you can move on to Using the Environment.


Sign in to add a comment
Hosted by Google Code