From af4ffb484baaf9edaf2da1760e2cf1b6205e7c54 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Sun, 14 Feb 2010 11:46:57 +0100 Subject: [PATCH] turn INSTALLED_APPS into a list, allowing .append() to be used instead of needing a global variable --- pyweb/settings.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pyweb/settings.py b/pyweb/settings.py index b769d1f..75e0277 100644 --- a/pyweb/settings.py +++ b/pyweb/settings.py @@ -208,7 +208,7 @@ TEST_RUNNER = 'mumble.testrunner.run_tests' TEST_MURMUR_LAB_DIR = join( dirname(MUMBLE_DJANGO_ROOT), 'murmur' ); TEST_MURMUR_FILES_DIR = join( MUMBLE_DJANGO_ROOT, 'testdata' ); -INSTALLED_APPS = ( +INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.admin', 'django.contrib.contenttypes', @@ -216,18 +216,17 @@ INSTALLED_APPS = ( 'django.contrib.sites', 'registration', 'mumble', -) +] def modprobe( name ): """ Try to import the named module, and if that works add it to INSTALLED_APPS. """ - global INSTALLED_APPS try: __import__( name ) except ImportError: pass else: - INSTALLED_APPS += ( name, ) + INSTALLED_APPS.append( name, ) # Check if rosetta is available. # http://code.google.com/p/django-rosetta