Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No need to include URLs manually. Additionally, imports only if urls.py is present. Can be useful when adding ability to create extensions without URLs (e.g., various helpers).
- Loading branch information
Julius
committed
Sep 20, 2015
1 parent
b1d9f1d
commit 3eff7e0
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from django.conf.urls import url, include | ||
|
||
from geokey.extensions.base import extensions | ||
|
||
|
||
urlpatterns = [] | ||
|
||
for extension in extensions: | ||
try: | ||
urls = '%s.urls' % extension | ||
__import__(urls) | ||
urlpatterns.append(url(r'^', include(urls, namespace=extension))) | ||
except ImportError: | ||
pass |