Skip to content
This repository
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 django_host_settings
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 setup.py
README.md

django-host-settings

Overview

django-host-settings is a Django app which helps you create and load settings unique to each host running your Django project.

Installation

$ easy_install django-host-settings

or

$ git clone git://github.com/sandersnewmedia/django-host-settings.git
$ cd django-host-settings
$ python setup.py install

Usage

In your settings.py:

INSTALLED_APPS = (
    ...
    'django_host_settings'
)

Then run these shell commands:

echo "import os" >> settings.py
echo "PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))" >> settings.py
python manage.py createhostsettings
echo "from django_host_settings.settings import *" >> settings.py

You can now override any settings in your own settings file, created in the config/ directory of your project's root.

For instance, if your hostname is sir-robin, the createhostsettings command will create a file, config/sir_robin.py that you could define Django settings in, such as DEBUG = True. These settings will be loaded along with, and override, the settings defined in settings.py.

Something went wrong with that request. Please try again.