Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Update Django] Django 5.1 #5288

Open
github-actions bot opened this issue Aug 8, 2024 · 5 comments
Open

[Update Django] Django 5.1 #5288

github-actions bot opened this issue Aug 8, 2024 · 5 comments

Comments

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2024

5.1 requirements tables

base.txt

Name Version in Master 5.1 Compatible Version OK
python-slugify 8.0.4 n/a
Pillow 11.0.0 n/a
rcssmin 1.1.2 n/a
argon2-cffi 23.1.0 n/a
whitenoise 6.8.2 6.7.0
redis 5.2.1 n/a
hiredis 3.1.0 n/a
celery 5.4.0 n/a
django-celery-beat 2.7.0 2.7.0
flower 2.0.1 n/a
uvicorn 0.32.1 n/a
uvicorn-worker 0.2.0 n/a
django 5.0.10 2.7.0
django-environ 0.11.2
django-model-utils 5.0.0 5.0.0
django-allauth 65.3.0 64.1.0
django-crispy-forms 2.3 2.3
crispy-bootstrap5 2024.10 2024.10
django-compressor 4.5.1 4.5.1
django-redis 5.4.0
djangorestframework 3.15.2
django-cors-headers 4.6.0 4.4.0
drf-spectacular 0.28.0 0.28.0
django-webpack-loader 3.1.1 3.1.1

local.txt

Name Version in Master 5.1 Compatible Version OK
Werkzeug 3.1.3 n/a
ipdb 0.13.13 n/a
psycopg 3.2.3 n/a
watchfiles 1.0.3 n/a
mypy 1.13.0 n/a
django-stubs 5.1.1 5.1.1
pytest 8.3.4 n/a
pytest-sugar 1.0.0 n/a
djangorestframework-stubs 3.15.1 n/a
sphinx 8.1.3 n/a
sphinx-autobuild 2024.10.3 n/a
ruff 0.8.3 n/a
coverage 7.6.9 n/a
djlint 1.36.3 n/a
pre-commit 4.0.1 n/a
factory-boy 3.3.1 3.3.1
django-debug-toolbar 4.4.6
django-extensions 3.2.3
django-coverage-plugin 3.1.0
pytest-django 4.9.0 4.9.0

production.txt

Name Version in Master 5.1 Compatible Version OK
gunicorn 23.0.0 n/a
psycopg 3.2.3 n/a
Collectfasta 3.2.0 n/a
sentry-sdk 2.19.2 n/a
hiredis 3.1.0 n/a
django-storages 1.14.4
django-anymail 12.0 12.0
@foarsitter
Copy link
Collaborator

django-storages 1.14.4 should be good according to jschneier/django-storages#1444

@foarsitter
Copy link
Collaborator

@browniebroke you did some upstream work on DRF on this topic. Is it compatible with Django 5.1 or do we need to await a release?

@browniebroke
Copy link
Member

I did add it to the CI and everything passes without any changes. At work, we've got our main project running Django 5.1 and DRF 3.15 and didn't notice any issues.

The only known incompatibility is that the current DRF 3.15 doesn't support LoginRequiredMiddleware. It's fixed in the DRF master branch but currently unreleased.

@joelpelaez
Copy link

@browniebroke I found an issue while running CI from Django 5.0.9 to 5.1.2.

If a project is generated with option username_type to username, the test TestUserAdmin.test_add fails with an error like this:

django.core.exceptions.FieldError: Unknown field(s) (usable_password) specified for User. Check fields/fieldsets/exclude attributes of class UserAdmin.

This is caused by multiples changes in Django 5.1:

django/django#16942
django/django#18484

This change introduces a new field named usable_password, and it can cause conflicts with customized UserAdminCreationForm

The new default value of UserAdmin.add_fieldsets is this:

django/django/blob/263f7319192b217c4e3b1eea0ea7809836392bbc/django/contrib/auth/admin.py

When username_type is username the custom UserAdmin doesn't change the field value, only if email type is selected:

{%- if cookiecutter.username_type == "email" %}
ordering = ["id"]
add_fieldsets = (
(
None,
{
"classes": ("wide",),
"fields": ("email", "password1", "password2"),
},
),
)
{%- endif %}

In Django documentation gives a possible solution: replace UserCreationForm by AdminUserCreationForm, but it was included in Django 5.1.1 and it requires update Django dependency version from series 5.0 to 5.1.

@browniebroke
Copy link
Member

Yes we may have to adapt a few things, and thanks for sharing that, will be useful when we get to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants