Skip to contentSkip to conversation

Convert logout to a POST request, as GET is not longer supported by the new Djang 5.2 TLS.

PATCH Applied Piotr Buliński 2 participants 7 messages Mar 29 – Mar 30 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Convert logout to a POST request, as GET is not longer supported by the new Djang 5.2 TLS.

---
 templates/base.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
templates/base.html +2 -1
index e167139..e31238c 100644
@@ -30,6 +30,7 @@
 <body>
     {% block header %}
     {% autoescape on %}
+    <form id="logout-form" method="post" action="{% url 'logout' %}">{% csrf_token %}</form>
     <nav class="navbar navbar-default navbar-fixed-top">
         <div class="container-fluid">
             <div class="navbar-header">
@@ -53,7 +54,7 @@
                             <b class="caret"></b>
                         </button>
                         <ul class="dropdown-menu">
-                            <li><a href="{% url 'logout' %}">{% trans "Log out" %}</a></li>
+                            <li><a href="#" onclick="document.getElementById('logout-form').submit(); return false;">{% trans "Log out" %}</a></li>
                             <li><a href="{% url 'password_change' %}">{% trans "Change password" %}</a></li>
                             <li><a href="{% url 'profile' %}?return_to={{ request.path }}">{% trans "Edit profile" %}</a></li>
                         </ul>
#1 lore raw

PATCH 2/3 Update settings.py to work with Django 5.2

1. Remove USE_L10N, as it's removed since Django version 5.0
2. Set USE_TZ = False, as in Django 5.0 the default was changed to True

---
 docker/settings.py | 6 +++---
 settings.py        | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
docker/settings.py +3 -3
index 9a96e83..fdf09de 100644
@@ -45,9 +45,9 @@ SITE_ID = 1
 # to load the internationalization machinery.
 USE_I18N = True
 
-# If you set this to False, Django will not format dates, numbers and
-# calendars according to the current locale
-USE_L10N = True
+# As of Django 5.0 the defaults has changed to True, so set it to False to avoid
+# timezone-aware datetimes which require more complex handling in the codebase.
+USE_TZ = False
 
 # Avoid specific paths
 BASE_DIR = os.getenv('BASE_DIR', os.path.dirname(__file__))
settings.py +3 -3
index fa303b1..bbc5aca 100644
@@ -45,9 +45,9 @@ SITE_ID = 1
 # to load the internationalization machinery.
 USE_I18N = True
 
-# If you set this to False, Django will not format dates, numbers and
-# calendars according to the current locale
-USE_L10N = True
+# As of Django 5.0 the defaults has changed to True, so set it to False to avoid
+# timezone-aware datetimes which require more complex handling in the codebase.
+USE_TZ = False
 
 # Avoid specific paths
 BASE_DIR = os.path.dirname(__file__)
Applied
#2 lore raw

Re: [yocto-patches] [layerindex-web][PATCH 2/3] Update settings.py to work with Django 5.2

Merged to master. Thank you.

Quoted 62 lines · Piotr Buliński via lists.yoctoproject.org

1. Remove USE_L10N, as it's removed since Django version 5.0
2. Set USE_TZ = False, as in Django 5.0 the default was changed to True

---
 docker/settings.py | 6 +++---
 settings.py        | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
docker/settings.py +1 -3
index 9a96e83..fdf09de 100644
@@ -45,9 +45,9 @@ SITE_ID = 1
 # to load the internationalization machinery.
 USE_I18N = True
 
-# If you set this to False, Django will not format dates, numbers and
-# calendars according to the current locale
-USE_L10N = True
+# As of Django 5.0 the defaults has changed to True, so set it to False

to avoid
+# timezone-aware datetimes which require more complex handling in the codebase.

docker/settings.py +1 -0
+USE_TZ = False
 
 # Avoid specific paths
 BASE_DIR = os.getenv('BASE_DIR', os.path.dirname(__file__))
settings.py +1 -3
index fa303b1..bbc5aca 100644
@@ -45,9 +45,9 @@ SITE_ID = 1
 # to load the internationalization machinery.
 USE_I18N = True
 
-# If you set this to False, Django will not format dates, numbers and
-# calendars according to the current locale
-USE_L10N = True
+# As of Django 5.0 the defaults has changed to True, so set it to False

to avoid
+# timezone-aware datetimes which require more complex handling in the codebase.
+USE_TZ = False

# Avoid specific paths
BASE_DIR = os.path.dirname(__file__)

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#3576):
https://lists.yoctoproject.org/g/yocto-patches/message/3576
Mute This Topic: https://lists.yoctoproject.org/mt/118566580/924729
Group Owner: [email protected] Unsubscribe:
https://lists.yoctoproject.org/g/yocto-patches/leave/13169857/924729/1023951714/xyzzy
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

PATCH 3/3 Update Django from 4.2 LTS to 5.2 LTS

In reply to Piotr Buliński

This change also updates other dependencies, to ensure compatibility with the new version of Django.

---
 requirements.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
requirements.txt +4 -4
index 767d4bc..0aea1f6 100644
@@ -10,17 +10,17 @@ click-plugins==1.1.1
 click-repl==0.3.0
 confusable-homoglyphs==3.3.1
 diff-match-patch==20230430
-Django>=4.2.28,<4.3
+Django>=5.2,<5.3
 django-appconf==1.0.6
-django-axes==6.5.1
+django-axes==7.1.0
 django-cors-headers==4.4.0
 django-ipware==7.0.1
 django-ranged-response==0.2.0
-django-registration==3.4
+django-registration==5.2.1
 django-reversion==5.1.0
 django-reversion-compare==0.17.0
 django-simple-captcha==0.6.3
-djangorestframework==3.15.2
+djangorestframework==3.16.1
 gitdb==4.0.11
 GitPython==3.1.43
 kombu==5.4.0
Applied
#4 lore raw

Re: [yocto-patches] [layerindex-web][PATCH 3/3] Update Django from 4.2 LTS to 5.2 LTS

Merged to master. Thank you.

Quoted 49 lines · Piotr Buliński via lists.yoctoproject.org

This change also updates other dependencies, to ensure compatibility with the new version of Django.

---
 requirements.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
requirements.txt +4 -5
index 767d4bc..0aea1f6 100644
@@ -10,17 +10,17 @@ click-plugins==1.1.1
 click-repl==0.3.0
 confusable-homoglyphs==3.3.1
 diff-match-patch==20230430
-Django>=4.2.28,<4.3
+Django>=5.2,<5.3
 django-appconf==1.0.6
-django-axes==6.5.1
+django-axes==7.1.0
 django-cors-headers==4.4.0
 django-ipware==7.0.1
 django-ranged-response==0.2.0
-django-registration==3.4
+django-registration==5.2.1
 django-reversion==5.1.0
 django-reversion-compare==0.17.0
 django-simple-captcha==0.6.3
-djangorestframework==3.15.2
+djangorestframework==3.16.1
 gitdb==4.0.11
 GitPython==3.1.43
 kombu==5.4.0
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group. View/Reply Online (#3577):
https://lists.yoctoproject.org/g/yocto-patches/message/3577
Mute This Topic: https://lists.yoctoproject.org/mt/118566582/924729
Group Owner: [email protected] Unsubscribe:
https://lists.yoctoproject.org/g/yocto-patches/leave/13169857/924729/1023951714/xyzzy
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Re: [yocto-patches] [layerindex-web][PATCH 3/3] Update Django from 4.2 LTS to 5.2 LTS

As of today, your patches are live on layers.openembedded.org

Quoted 66 lines · Tim Orling via lists.yoctoproject.org

Merged to master. Thank you.

Quoted 39 lines · Piotr Buliński via lists.yoctoproject.org

This change also updates other dependencies, to ensure compatibility with the new version of Django.

---
 requirements.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
requirements.txt +4 -4
index 767d4bc..0aea1f6 100644
@@ -10,17 +10,17 @@ click-plugins==1.1.1
 click-repl==0.3.0
 confusable-homoglyphs==3.3.1
 diff-match-patch==20230430
-Django>=4.2.28,<4.3
+Django>=5.2,<5.3
 django-appconf==1.0.6
-django-axes==6.5.1
+django-axes==7.1.0
 django-cors-headers==4.4.0
 django-ipware==7.0.1
 django-ranged-response==0.2.0
-django-registration==3.4
+django-registration==5.2.1
 django-reversion==5.1.0
 django-reversion-compare==0.17.0
 django-simple-captcha==0.6.3
-djangorestframework==3.15.2
+djangorestframework==3.16.1
 gitdb==4.0.11
 GitPython==3.1.43
 kombu==5.4.0
Quoted 1 line

_._,_._,_

------------------------------
Links:

You receive all messages sent to this group.

View/Reply Online (#3580)
<https://lists.yoctoproject.org/g/yocto-patches/message/3580> | Reply to
Group <[email protected]?subject=Re:%20Re%3A%20%5Byocto-patches%5D%20%5Blayerindex-web%5D%5BPATCH%203%2F3%5D%20Update%20Django%20from%204.2%20LTS%20to%205.2%20LTS> | Reply to Sender <[email protected]?subject=Private:%20Re:%20Re%3A%20%5Byocto-patches%5D%20%5Blayerindex-web%5D%5BPATCH%203%2F3%5D%20Update%20Django%20from%204.2%20LTS%20to%205.2%20LTS> | Mute This Topic <https://lists.yoctoproject.org/mt/118566582/924729> | New
Topic <https://lists.yoctoproject.org/g/yocto-patches/post>
Your Subscription
<https://lists.yoctoproject.org/g/yocto-patches/editsub/924729> | Contact
Group Owner <[email protected]> | Unsubscribe
<https://lists.yoctoproject.org/g/yocto-patches/leave/13169857/924729/1023951714/xyzzy>
[[email protected]]
_._,_._,_

Applied
#7 lore raw
In reply to Piotr Buliński

Minor tweak to subject line: Djang -> Django.

Merged to master. Thank you.

Quoted 47 lines · Piotr Buliński via lists.yoctoproject.org
---
 templates/base.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
templates/base.html +1 -0
index e167139..e31238c 100644
@@ -30,6 +30,7 @@
 <body>
     {% block header %}
     {% autoescape on %}
+    <form id="logout-form" method="post" action="{% url 'logout' %}">{%

csrf_token %}</form>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">

templates/base.html +0 -1
@@ -53,7 +54,7 @@
                             <b class="caret"></b>
                         </button>
                         <ul class="dropdown-menu">
-                            <li><a href="{% url 'logout' %}">{% trans

"Log out" %}</a></li>
+ <li><a href="#"
onclick="document.getElementById('logout-form').submit(); return false;">{% trans "Log out" %}</a></li>

                             <li><a href="{% url 'password_change' %}">{%
trans "Change password" %}</a></li>
                             <li><a href="{% url 'profile' %}?return_to={{
request.path }}">{% trans "Edit profile" %}</a></li>
                         </ul>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#3575):
https://lists.yoctoproject.org/g/yocto-patches/message/3575
Mute This Topic: https://lists.yoctoproject.org/mt/118566576/924729
Group Owner: [email protected] Unsubscribe:
https://lists.yoctoproject.org/g/yocto-patches/leave/13169857/924729/1023951714/xyzzy
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-