Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import importlib, os
- APP_DIRS = (os.path.abspath(os.path.join(PROJECT_ROOT, 'test')),)
- sys.path.extend(APP_DIRS)
- BASE_URL_CONFS = []
- for app_dir in APP_DIRS:
- for app in os.listdir(app_dir):
- if not app.startswith('.') and app not in INSTALLED_APPS:
- try:
- app_settings = importlib.import_module('%s.settings' % app)
- if getattr(app_settings, 'APP_NAME', '') != '':
- print "Auto Installed %s" % app
- INSTALLED_APPS = INSTALLED_APPS + (app,)
- base_url_conf = getattr(app_settings, 'BASE_URL_CONF', '')
- if base_url_conf != '':
- BASE_URL_CONFS.append(base_url_conf)
- except ImportError:
- pass
Add Comment
Please, Sign In to add comment