| 310 | | I ([http://djangopeople.net/akaihola Antti Kaihola]) have used the following solution to modify settings which are tuples or lists. This is handy e.g. when separating app-specific settings to their own files. |
| | 310 | I ([http://djangopeople.net/akaihola Antti Kaihola]) use the following solution for defining local settings. It provides access to the original settings while defining local settings. Note: this only works if you import from the base {{{settings.py}}} or {{{settings/__init__.py}}}. |
| | 311 | |
| | 312 | settings/__init__.py: |
| | 313 | {{{ |
| | 314 | INSTALLED_APPS = ('whatever',) |
| | 315 | try: |
| | 316 | from settings.local import * |
| | 317 | except ImportError: |
| | 318 | pass |
| | 319 | }}} |
| | 320 | |
| | 321 | settings/local.py: |
| | 322 | {{{ |
| | 323 | import sys |
| | 324 | globals().update(vars(sys.modules['settings'])) |
| | 325 | |
| | 326 | INSTALLED_APPS += ('another_app',) |
| | 327 | }}} |
| | 328 | |
| | 329 | Older, clumsier methods I've used: |