This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!
Project Description

Simple helpers for setting up your Django settings file


Inside your file, do the following:

from dj_settings_helpers import create_project_dir, get_env
project_dir = create_project_dir(__file__)

Now, you can use project_dir to generate paths relative to your file and get_env to load environment variables.

For example, you can use it to add your project_root/templates directory to your TEMPLATES_DIRS setting like this:


You can use the get_env variable to pull in environment variables with defaults that depend on the ENVIRONMENT variable. For example, you can set multiple default BROKER_HOST variables for Celery like this:

BROKER_HOST = get_env('BROKER_HOST', '',
        dev='localhost', staging='')

If your ENVIRONMENT variable is equal to dev, the localhost string is used; if set to staging, it is, and all other environments use All of these are overridden by the presence of an environment variable named BROKER_HOST.

Please see the inline documentation in for full examples and usage.


pip install dj-settings-helpers


Copyright 2012 Travis Swicegood

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
dj-settings-helpers-1.0.0.tar.gz (3.2 kB) Copy SHA256 Checksum SHA256 Source Nov 3, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting