diff options
| author | David Reyna <David.Reyna@windriver.com> | 2020-03-25 21:24:55 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-29 20:02:36 +0100 |
| commit | 4dabdbe11ddc47a885c7f8cc6b3f26439d40d77c (patch) | |
| tree | 1cfd3f48830d5688e65c283c181767d74a951358 /bitbake/lib/toaster/toastermain | |
| parent | 7e252ef31094f760b5666aec9b2205166a8ccbd2 (diff) | |
| download | poky-4dabdbe11ddc47a885c7f8cc6b3f26439d40d77c.tar.gz | |
bitbake: toaster: migrate to Django-2.2
Toaster migration to Django-2.2. Django-1.x has been deprecated.
[YOCTO #13207]
(Bitbake rev: 9730f95686b2ac72cf1fa513c555f7c7787e2667)
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')
| -rw-r--r-- | bitbake/lib/toaster/toastermain/management/commands/buildimport.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastermain/settings.py | 17 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastermain/urls.py | 4 |
3 files changed, 11 insertions, 12 deletions
diff --git a/bitbake/lib/toaster/toastermain/management/commands/buildimport.py b/bitbake/lib/toaster/toastermain/management/commands/buildimport.py index 3e246fda83..7718caa57a 100644 --- a/bitbake/lib/toaster/toastermain/management/commands/buildimport.py +++ b/bitbake/lib/toaster/toastermain/management/commands/buildimport.py | |||
| @@ -466,7 +466,6 @@ class Command(BaseCommand): | |||
| 466 | release_name = 'None' if not pl.layercommit.release else pl.layercommit.release.name | 466 | release_name = 'None' if not pl.layercommit.release else pl.layercommit.release.name |
| 467 | print(" AFTER :ProjectLayer=%s,%s,%s,%s" % (pl.layercommit.layer.name,release_name,pl.layercommit.branch,pl.layercommit.commit)) | 467 | print(" AFTER :ProjectLayer=%s,%s,%s,%s" % (pl.layercommit.layer.name,release_name,pl.layercommit.branch,pl.layercommit.commit)) |
| 468 | 468 | ||
| 469 | |||
| 470 | def handle(self, *args, **options): | 469 | def handle(self, *args, **options): |
| 471 | project_name = options['name'] | 470 | project_name = options['name'] |
| 472 | project_path = options['path'] | 471 | project_path = options['path'] |
| @@ -551,6 +550,7 @@ class Command(BaseCommand): | |||
| 551 | # preset the mode and default image recipe | 550 | # preset the mode and default image recipe |
| 552 | project.set_variable(Project.PROJECT_SPECIFIC_ISNEW,Project.PROJECT_SPECIFIC_NEW) | 551 | project.set_variable(Project.PROJECT_SPECIFIC_ISNEW,Project.PROJECT_SPECIFIC_NEW) |
| 553 | project.set_variable(Project.PROJECT_SPECIFIC_DEFAULTIMAGE,"core-image-minimal") | 552 | project.set_variable(Project.PROJECT_SPECIFIC_DEFAULTIMAGE,"core-image-minimal") |
| 553 | |||
| 554 | # Assert any extended/custom actions or variables for new non-Toaster projects | 554 | # Assert any extended/custom actions or variables for new non-Toaster projects |
| 555 | if not len(self.toaster_vars): | 555 | if not len(self.toaster_vars): |
| 556 | pass | 556 | pass |
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 74501fa26b..a4b370c8d4 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py | |||
| @@ -189,15 +189,16 @@ TEMPLATES = [ | |||
| 189 | }, | 189 | }, |
| 190 | ] | 190 | ] |
| 191 | 191 | ||
| 192 | MIDDLEWARE_CLASSES = ( | 192 | MIDDLEWARE = [ |
| 193 | 'django.middleware.common.CommonMiddleware', | 193 | 'django.middleware.common.CommonMiddleware', |
| 194 | 'django.contrib.sessions.middleware.SessionMiddleware', | 194 | 'django.contrib.sessions.middleware.SessionMiddleware', |
| 195 | 'django.middleware.csrf.CsrfViewMiddleware', | 195 | 'django.middleware.csrf.CsrfViewMiddleware', |
| 196 | 'django.contrib.auth.middleware.AuthenticationMiddleware', | 196 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 197 | 'django.contrib.messages.middleware.MessageMiddleware', | 197 | 'django.contrib.messages.middleware.MessageMiddleware', |
| 198 | # Uncomment the next line for simple clickjacking protection: | 198 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 199 | # 'django.middleware.clickjacking.XFrameOptionsMiddleware', | 199 | 'django.contrib.messages.middleware.MessageMiddleware', |
| 200 | ) | 200 | 'django.contrib.sessions.middleware.SessionMiddleware', |
| 201 | ] | ||
| 201 | 202 | ||
| 202 | CACHES = { | 203 | CACHES = { |
| 203 | # 'default': { | 204 | # 'default': { |
| @@ -248,7 +249,7 @@ FRESH_ENABLED = False | |||
| 248 | if os.environ.get('TOASTER_DEVEL', None) is not None: | 249 | if os.environ.get('TOASTER_DEVEL', None) is not None: |
| 249 | try: | 250 | try: |
| 250 | import fresh | 251 | import fresh |
| 251 | MIDDLEWARE_CLASSES = ("fresh.middleware.FreshMiddleware",) + MIDDLEWARE_CLASSES | 252 | MIDDLEWARE = ["fresh.middleware.FreshMiddleware",] + MIDDLEWARE |
| 252 | INSTALLED_APPS = INSTALLED_APPS + ('fresh',) | 253 | INSTALLED_APPS = INSTALLED_APPS + ('fresh',) |
| 253 | FRESH_ENABLED = True | 254 | FRESH_ENABLED = True |
| 254 | except: | 255 | except: |
| @@ -258,8 +259,8 @@ DEBUG_PANEL_ENABLED = False | |||
| 258 | if os.environ.get('TOASTER_DEVEL', None) is not None: | 259 | if os.environ.get('TOASTER_DEVEL', None) is not None: |
| 259 | try: | 260 | try: |
| 260 | import debug_toolbar, debug_panel | 261 | import debug_toolbar, debug_panel |
| 261 | MIDDLEWARE_CLASSES = ('debug_panel.middleware.DebugPanelMiddleware',) + MIDDLEWARE_CLASSES | 262 | MIDDLEWARE = ['debug_panel.middleware.DebugPanelMiddleware',] + MIDDLEWARE |
| 262 | #MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + ('debug_toolbar.middleware.DebugToolbarMiddleware',) | 263 | #MIDDLEWARE = MIDDLEWARE + ['debug_toolbar.middleware.DebugToolbarMiddleware',] |
| 263 | INSTALLED_APPS = INSTALLED_APPS + ('debug_toolbar','debug_panel',) | 264 | INSTALLED_APPS = INSTALLED_APPS + ('debug_toolbar','debug_panel',) |
| 264 | DEBUG_PANEL_ENABLED = True | 265 | DEBUG_PANEL_ENABLED = True |
| 265 | 266 | ||
| @@ -352,5 +353,3 @@ def activate_synchronous_off(sender, connection, **kwargs): | |||
| 352 | connection_created.connect(activate_synchronous_off) | 353 | connection_created.connect(activate_synchronous_off) |
| 353 | # | 354 | # |
| 354 | 355 | ||
| 355 | |||
| 356 | |||
diff --git a/bitbake/lib/toaster/toastermain/urls.py b/bitbake/lib/toaster/toastermain/urls.py index ac77bc3632..5fb520b384 100644 --- a/bitbake/lib/toaster/toastermain/urls.py +++ b/bitbake/lib/toaster/toastermain/urls.py | |||
| @@ -51,7 +51,7 @@ if toastermain.settings.DEBUG_PANEL_ENABLED: | |||
| 51 | 51 | ||
| 52 | urlpatterns = [ | 52 | urlpatterns = [ |
| 53 | # Uncomment the next line to enable the admin: | 53 | # Uncomment the next line to enable the admin: |
| 54 | url(r'^admin/', include(admin.site.urls)), | 54 | url(r'^admin/', admin.site.urls), |
| 55 | ] + urlpatterns | 55 | ] + urlpatterns |
| 56 | 56 | ||
| 57 | # Automatically discover urls.py in various apps, beside our own | 57 | # Automatically discover urls.py in various apps, beside our own |
| @@ -69,7 +69,7 @@ for t in os.walk(os.path.dirname(currentdir)): | |||
| 69 | # make sure we don't have this module name in | 69 | # make sure we don't have this module name in |
| 70 | conflict = False | 70 | conflict = False |
| 71 | for p in urlpatterns: | 71 | for p in urlpatterns: |
| 72 | if p.regex.pattern == '^' + modulename + '/': | 72 | if p.pattern.regex.pattern == '^' + modulename + '/': |
| 73 | conflict = True | 73 | conflict = True |
| 74 | if not conflict: | 74 | if not conflict: |
| 75 | urlpatterns.insert(0, url(r'^' + modulename + '/', include ( modulename + '.urls'))) | 75 | urlpatterns.insert(0, url(r'^' + modulename + '/', include ( modulename + '.urls'))) |
