diff options
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/toaster/toastermain/urls.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/toastermain/urls.py b/bitbake/lib/toaster/toastermain/urls.py index ede5e4f96f..0e7b5c2d77 100644 --- a/bitbake/lib/toaster/toastermain/urls.py +++ b/bitbake/lib/toaster/toastermain/urls.py | |||
@@ -27,12 +27,10 @@ from django.views.decorators.cache import never_cache | |||
27 | # Uncomment the next two lines to enable the admin: | 27 | # Uncomment the next two lines to enable the admin: |
28 | # from django.contrib import admin | 28 | # from django.contrib import admin |
29 | # admin.autodiscover() | 29 | # admin.autodiscover() |
30 | |||
31 | urlpatterns = patterns('', | 30 | urlpatterns = patterns('', |
32 | url(r'^simple/', include('bldviewer.urls')), | ||
33 | url(r'^api/1.0/', include('bldviewer.api')), | 31 | url(r'^api/1.0/', include('bldviewer.api')), |
34 | url(r'^gui/', include('toastergui.urls')), | 32 | url(r'^$', never_cache(RedirectView.as_view(url='/toastergui/'))), |
35 | url(r'^$', never_cache(RedirectView.as_view(url='/gui/'))), | 33 | |
36 | # Examples: | 34 | # Examples: |
37 | # url(r'^toaster/', include('toaster.foo.urls')), | 35 | # url(r'^toaster/', include('toaster.foo.urls')), |
38 | 36 | ||
@@ -42,3 +40,13 @@ urlpatterns = patterns('', | |||
42 | # Uncomment the next line to enable the admin: | 40 | # Uncomment the next line to enable the admin: |
43 | # url(r'^admin/', include(admin.site.urls)), | 41 | # url(r'^admin/', include(admin.site.urls)), |
44 | ) | 42 | ) |
43 | |||
44 | # Automatically discover urls.py in various apps, beside our own | ||
45 | # and map module directories to the patterns | ||
46 | |||
47 | import os | ||
48 | currentdir = os.path.dirname(__file__) | ||
49 | for t in os.walk(os.path.dirname(currentdir)): | ||
50 | if "urls.py" in t[2] and t[0] != currentdir: | ||
51 | modulename = os.path.basename(t[0]) | ||
52 | urlpatterns.append( url(r'^' + modulename + '/', include ( modulename + '.urls'))) | ||