diff options
author | David Reyna <David.Reyna@windriver.com> | 2017-06-27 13:44:28 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-28 16:02:15 +0100 |
commit | d74bcbeaf241a67871d62b7e2c17900ae900642e (patch) | |
tree | bd0bf6037a0de26e7668f146ec6ff4afde07e54f /bitbake/lib/toaster/toastermain/urls.py | |
parent | c3058ec4a4f2f4c57116816a5bede1e61a5a4cc4 (diff) | |
download | poky-d74bcbeaf241a67871d62b7e2c17900ae900642e.tar.gz |
bitbake: toaster: address Django-1.10 API deprecations
There are four main API deprecations in Django-1.10:
(a) String view arguments to url() must be replaced by
the explicit class reference
(b) New TEMPLATES stucture in settings.py consolidates
TEMPLATE_DIRS, TEMPLATE_CONTEXT_PROCESSORS,
TEMPLATE_LOADERS, TEMPLATE_STRING_IF_INVALID, and
TEMPLATE_DEBUG
(c) patterns() wrapper in url() is removed, with
urlpatterns now a simple list
(d) NoArgsCommand in commands() must be replace by
BaseCommand, and handle_noargs() changed to
handle()
Also, the Django version checker must be updated to accept
two digit sub-version numbers (e.g. "1.8" < "1.10")
[YOCTO #11684]
(Bitbake rev: e4c7a94fac7a53fc146387a57e5a09b9ec3caca0)
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastermain/urls.py')
-rw-r--r-- | bitbake/lib/toaster/toastermain/urls.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastermain/urls.py b/bitbake/lib/toaster/toastermain/urls.py index 1f8599edc3..bb325596bb 100644 --- a/bitbake/lib/toaster/toastermain/urls.py +++ b/bitbake/lib/toaster/toastermain/urls.py | |||
@@ -23,6 +23,8 @@ 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 bldcollector.views | ||
27 | |||
26 | import logging | 28 | import logging |
27 | 29 | ||
28 | logger = logging.getLogger("toaster") | 30 | logger = logging.getLogger("toaster") |
@@ -31,7 +33,7 @@ logger = logging.getLogger("toaster") | |||
31 | from django.contrib import admin | 33 | from django.contrib import admin |
32 | admin.autodiscover() | 34 | admin.autodiscover() |
33 | 35 | ||
34 | urlpatterns = patterns('', | 36 | urlpatterns = [ |
35 | 37 | ||
36 | # Examples: | 38 | # Examples: |
37 | # url(r'^toaster/', include('toaster.foo.urls')), | 39 | # url(r'^toaster/', include('toaster.foo.urls')), |
@@ -42,11 +44,11 @@ urlpatterns = patterns('', | |||
42 | 44 | ||
43 | # This is here to maintain backward compatibility and will be deprecated | 45 | # This is here to maintain backward compatibility and will be deprecated |
44 | # in the future. | 46 | # in the future. |
45 | url(r'^orm/eventfile$', 'bldcollector.views.eventfile'), | 47 | url(r'^orm/eventfile$', bldcollector.views.eventfile), |
46 | 48 | ||
47 | # if no application is selected, we have the magic toastergui app here | 49 | # if no application is selected, we have the magic toastergui app here |
48 | url(r'^$', never_cache(RedirectView.as_view(url='/toastergui/', permanent=True))), | 50 | url(r'^$', never_cache(RedirectView.as_view(url='/toastergui/', permanent=True))), |
49 | ) | 51 | ] |
50 | 52 | ||
51 | import toastermain.settings | 53 | import toastermain.settings |
52 | 54 | ||