Guest User

Untitled

a guest
Apr 16th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. import importlib, os
  2. APP_DIRS = (os.path.abspath(os.path.join(PROJECT_ROOT, 'test')),)
  3. sys.path.extend(APP_DIRS)
  4. BASE_URL_CONFS = []
  5. for app_dir in APP_DIRS:
  6. for app in os.listdir(app_dir):
  7. if not app.startswith('.') and app not in INSTALLED_APPS:
  8. try:
  9. app_settings = importlib.import_module('%s.settings' % app)
  10. if getattr(app_settings, 'APP_NAME', '') != '':
  11. print "Auto Installed %s" % app
  12. INSTALLED_APPS = INSTALLED_APPS + (app,)
  13. base_url_conf = getattr(app_settings, 'BASE_URL_CONF', '')
  14. if base_url_conf != '':
  15. BASE_URL_CONFS.append(base_url_conf)
  16. except ImportError:
  17. pass
Add Comment
Please, Sign In to add comment