Browse Source

automatically detect if rosetta and django_extensions are available

Natenom/support-murmur-13-1446181288462
Michael Ziegler 14 years ago
parent
commit
6b85f6f693
  1. 22
      pyweb/settings.py

22
pyweb/settings.py

@ -198,8 +198,22 @@ INSTALLED_APPS = (
'django.contrib.sites',
'registration',
'mumble',
# If you have django-rosetta installed, uncomment the next line. The URL
# and a link in the main template will then be added automatically.
# http://code.google.com/p/django-rosetta
#'rosetta',
)
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, )
# Check if rosetta is available.
# http://code.google.com/p/django-rosetta
modprobe( "rosetta" )
# Check if django_extensions is available.
modprobe( "django_extensions" )
Loading…
Cancel
Save