Browse Source

turn INSTALLED_APPS into a list, allowing .append() to be used instead of needing a global variable

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
af4ffb484b
  1. 7
      pyweb/settings.py

7
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_LAB_DIR = join( dirname(MUMBLE_DJANGO_ROOT), 'murmur' );
TEST_MURMUR_FILES_DIR = join( MUMBLE_DJANGO_ROOT, 'testdata' ); TEST_MURMUR_FILES_DIR = join( MUMBLE_DJANGO_ROOT, 'testdata' );
INSTALLED_APPS = (
INSTALLED_APPS = [
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
@ -216,18 +216,17 @@ INSTALLED_APPS = (
'django.contrib.sites', 'django.contrib.sites',
'registration', 'registration',
'mumble', 'mumble',
)
]
def modprobe( name ): def modprobe( name ):
""" Try to import the named module, and if that works add it to INSTALLED_APPS. """ """ Try to import the named module, and if that works add it to INSTALLED_APPS. """
global INSTALLED_APPS
try: try:
__import__( name ) __import__( name )
except ImportError: except ImportError:
pass pass
else: else:
INSTALLED_APPS += ( name, )
INSTALLED_APPS.append( name, )
# Check if rosetta is available. # Check if rosetta is available.
# http://code.google.com/p/django-rosetta # http://code.google.com/p/django-rosetta

Loading…
Cancel
Save