Load site settings into the Django settings object on each request

Review Request #620 — Created Nov. 1, 2008 and submitted


Review Board SVN (deprecated)


This change works along with /r/619 to help fix the siteconfig settings issues people are hitting. Instead of loading everything from the SiteConfiguration object into django.conf.settings the first time urls.py is loaded, we now do this on each request. It's extra work, but not too much.

Down the road, I plan to fix up Djblets to be more intelligent about scanning for siteconfig.py modules and calling a load_site_config function in each if found only when we've loaded in a new SiteConfiguration, so that we don't actually need to do this on each request but instead only do it when needed.
Performed the same tests in /r/619.
  2. /trunk/reviewboard/settings.py (Diff revision 1)
    Could we alphabetize?
    1. Nope, settings must be processed first. Normally I'm a real stickler for alphabetizing lists, but we can't here. In fact, I actually needed to move LoadSettingsMiddleware before LoggingMiddleware to fix logging issues.