Login

local_settings override for project settings

Author:
Magus
Posted:
March 13, 2008
Language:
Python
Version:
.96
Tags:
settings
Score:
10 (after 10 ratings)

Place this snippet at the bottom of your settings.py file, and if a local_settings.py file is present in the directory, all settings in that file will override those in settings.py

1
2
3
4
try:
    from local_settings import *
except ImportError, exp:
    pass

More like this

  1. Serialize a model instance by chriswedgwood 1 week, 6 days ago
  2. Automatically setup raw_id_fields ForeignKey & OneToOneField by agusmakmun 9 months, 2 weeks ago
  3. Crispy Form by sourabhsinha396 10 months, 1 week ago
  4. ReadOnlySelect by mkoistinen 10 months, 2 weeks ago
  5. Verify events sent to your webhook endpoints by santos22 11 months, 2 weeks ago

Comments

bjornkri (on March 13, 2008):

Ah, that's perfect! Much more elegant than my method... which is too embarrassing to mention here.

#

Please login first before commenting.