Changes between Version 14 and Version 15 of SplitSettings
- Timestamp:
- Oct 1, 2010, 11:07:07 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SplitSettings
v14 v15 310 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 311 312 settings/__init__.py:312 {{{settings/__init__.py}}}: 313 313 {{{ 314 314 INSTALLED_APPS = ('whatever',) … … 319 319 }}} 320 320 321 settings/local.py:321 {{{settings/local.py}}}: 322 322 {{{ 323 323 import sys … … 329 329 Older, clumsier methods I've used: 330 330 331 settings.py:331 {{{settings.py}}}: 332 332 {{{ 333 333 INSTALLED_APPS = ('whatever',) … … 336 336 }}} 337 337 338 more_settings.py:338 {{{more_settings.py}}}: 339 339 {{{ 340 340 def modify(settings): … … 357 357 I ([http://djangopeople.net/cordis Sergey Yushckeyev]) have extended proposed solution: 358 358 359 env 359 {{{env}}} 360 360 {{{ 361 361 export APP_SETTINGS = 'development.cordis' 362 362 }}} 363 363 364 settings/__init__.py 364 {{{settings/__init__.py}}} 365 365 {{{ 366 366 #!python … … 390 390 }}} 391 391 392 settings/development/cordis.py 392 {{{settings/development/cordis.py}}} 393 393 {{{ 394 394 #!python … … 397 397 }}} 398 398 399 app/models.py 399 {{{app/models.py}}} 400 400 {{{ 401 401 #!python