diff options
Diffstat (limited to 'bitbake/lib/toaster/toastermain/urls.py')
-rw-r--r-- | bitbake/lib/toaster/toastermain/urls.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastermain/urls.py b/bitbake/lib/toaster/toastermain/urls.py index 6112067579..f66f11dcde 100644 --- a/bitbake/lib/toaster/toastermain/urls.py +++ b/bitbake/lib/toaster/toastermain/urls.py | |||
@@ -23,6 +23,9 @@ from django.conf.urls import patterns, include, url | |||
23 | from django.views.generic import RedirectView | 23 | from django.views.generic import RedirectView |
24 | from django.views.decorators.cache import never_cache | 24 | from django.views.decorators.cache import never_cache |
25 | 25 | ||
26 | import logging | ||
27 | |||
28 | logger = logging.getLogger("toaster") | ||
26 | 29 | ||
27 | # Uncomment the next two lines to enable the admin: | 30 | # Uncomment the next two lines to enable the admin: |
28 | from django.contrib import admin | 31 | from django.contrib import admin |
@@ -47,10 +50,12 @@ import toastermain.settings | |||
47 | 50 | ||
48 | if toastermain.settings.FRESH_ENABLED: | 51 | if toastermain.settings.FRESH_ENABLED: |
49 | urlpatterns.insert(1, url(r'', include('fresh.urls'))) | 52 | urlpatterns.insert(1, url(r'', include('fresh.urls'))) |
53 | logger.info("Enabled django-fresh extension") | ||
50 | 54 | ||
51 | if toastermain.settings.DEBUG_PANEL_ENABLED: | 55 | if toastermain.settings.DEBUG_PANEL_ENABLED: |
52 | import debug_toolbar | 56 | import debug_toolbar |
53 | urlpatterns.insert(1, url(r'', include(debug_toolbar.urls))) | 57 | urlpatterns.insert(1, url(r'', include(debug_toolbar.urls))) |
58 | logger.info("Enabled django_toolbar extension") | ||
54 | 59 | ||
55 | 60 | ||
56 | if toastermain.settings.MANAGED: | 61 | if toastermain.settings.MANAGED: |
@@ -70,4 +75,15 @@ for t in os.walk(os.path.dirname(currentdir)): | |||
70 | 75 | ||
71 | if "urls.py" in t[2] and t[0] != currentdir: | 76 | if "urls.py" in t[2] and t[0] != currentdir: |
72 | modulename = os.path.basename(t[0]) | 77 | modulename = os.path.basename(t[0]) |
73 | urlpatterns.insert(0, url(r'^' + modulename + '/', include ( modulename + '.urls'))) | 78 | # make sure we don't have this module name in |
79 | conflict = False | ||
80 | for p in urlpatterns: | ||
81 | if p.regex.pattern == '^' + modulename + '/': | ||
82 | conflict = True | ||
83 | if not conflict: | ||
84 | urlpatterns.insert(0, url(r'^' + modulename + '/', include ( modulename + '.urls'))) | ||
85 | else: | ||
86 | logger.warn("Module \'%s\' has a regexp conflict, was not added to the urlpatterns" % modulename) | ||
87 | |||
88 | from pprint import pformat | ||
89 | logger.debug("urlpatterns list %s", pformat(urlpatterns)) | ||