Created
September 7, 2016 03:41
-
-
Save raphaelsoul/1a4b8ea6fa58bb58562546b46f8fc48e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def load_apps(apps): | |
| import importlib | |
| GlobalUrls = [] | |
| for app in apps: | |
| module = importlib.import_module('app.{AppName}.urls'.format(AppName=app)) | |
| GlobalUrls += getattr(module,'urls') | |
| return GlobalUrls |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
so we can access
app.testapp.urlsand get the list namedurlsin this module dynamically.and if two element in a list for load_apps function were give, it will concat the lists and return it.
This implements the django-like app url