﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21330	More guidance on default settings in reusable applications is required	Daniele Procida	nobody	"There are numerous different ways of shipping reusable applications with sensible default settings so that the person reusing the application is not obliged to fill settings.py with numerous settings just to get started (if the application requires these settings).

Many of the easy-fix ways that this is done are poor, for example:

* in settings.py, `from app.default_settings import *`
* in app.default_settings, `SETTING = getattr(settings, ""SETTING"", ""value"")` (will cache settings values at module-level; breaks `@override_settings`) 

and many are tremendously complex.

loic84's suggestion:

{{{
# myapp/settings.py
 
DEFAULT_MYAPP_WIDTH = 100
DEFAULT_MYAPP_HEIGHT = 100
 
# myapp/views.py
 
from django.conf import settings
from myapp.settings import *
 
def view(request):
    print(getattr(settings, 'MYAPP_WIDTH', DEFAULT_MYAPP_WIDTH))
}}}

This is simple and robust enough to be recommended in the reusable apps tutorial, and should also be explained more fully along with the problem of module-level settings caching in the settings docs. 

There should also be a note in the testing docs warning about how `override_settings` can easily be broken."	New feature	new	Documentation	dev	Normal				Unreviewed	0	0	0	0	0	0
