Skip to content

Update Django from 5.0 to 5.1 - #5740

Merged
browniebroke merged 12 commits into
cookiecutter:masterfrom
pulse-mind:pyup-update-django-5.0-to-5.1b
Apr 2, 2025
Merged

browniebroke merged 12 commits into
cookiecutter:masterfrom
pulse-mind:pyup-update-django-5.0-to-5.1b

Conversation

@pulse-mind

@pulse-mind pulse-mind commented Mar 24, 2025

Copy link
Copy Markdown
Contributor

Description

Migrate Django 5.0 -> Django 5.1

Checklist:

  • I've made sure that tests are updated accordingly (especially if adding or updating a template option)
  • I've updated the documentation or confirm that my change doesn't require any updates

Rationale

Fix #5288

@pulse-mind pulse-mind changed the title Pyup update django 5.0 to 5.1b Pyup update django 5.0 to 5.1 Mar 24, 2025
@pulse-mind
pulse-mind force-pushed the pyup-update-django-5.0-to-5.1b branch 4 times, most recently from ec733a5 to 2f2865c Compare March 24, 2025 14:31
@pulse-mind
pulse-mind force-pushed the pyup-update-django-5.0-to-5.1b branch from 2f2865c to fd50643 Compare March 24, 2025 14:35
@foarsitter

Copy link
Copy Markdown
Collaborator

@pulse-mind ignore the align versions tests, that is beyond your scope I guess.

If you scroll down to the bottom of https://github.com/cookiecutter/cookiecutter-django/actions/runs/14038022599/job/39300820748?pr=5740 I see the following error:

django.db.utils.NotSupportedError: PostgreSQL 13 or later is required (found 12.22)

@pulse-mind

Copy link
Copy Markdown
Contributor Author

I've seen, I was surprised because I did not change that, but it is true Django 5.1 drop PostgreSQL 12.

@pulse-mind

Copy link
Copy Markdown
Contributor Author

Now I do not understand the errors.

@foarsitter

Copy link
Copy Markdown
Collaborator

mypy is failing:

my_awesome_project/users/tests/factories.py:30: error: "UserFactory" has no attribute "set_password"; maybe "password"?  [attr-defined]
my_awesome_project/users/tests/factories.py:35: error: "FactoryOptions" has no attribute "skip_postgeneration_save"  [attr-defined]
my_awesome_project/conftest.py:14: error: Incompatible return value type (got "UserFactory", expected "User")  [return-value]
my_awesome_project/users/forms.py:14: error: Name "admin_forms.AdminUserCreationForm" is not defined  [name-defined]
my_awesome_project/users/tests/test_views.py:88: error: Incompatible types in assignment (expression has type "UserFactory", variable has type "User | AnonymousUser")

Not sure if it's by design, but we don't run mypy against bare metal. As a result, the errors only show up during the Docker stages.

Comment thread {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py Outdated
Comment thread {{cookiecutter.project_slug}}/requirements/base.txt Outdated
Comment thread {{cookiecutter.project_slug}}/requirements/local.txt Outdated
@browniebroke browniebroke changed the title Pyup update django 5.0 to 5.1 Update Django from 5.0 to 5.1 Mar 24, 2025
pulse-mind and others added 2 commits March 24, 2025 17:09
@pulse-mind

Copy link
Copy Markdown
Contributor Author

I solved all issues. Thank you for your help.

@browniebroke
browniebroke merged commit 7d8dabb into cookiecutter:master Apr 2, 2025
@browniebroke

Copy link
Copy Markdown
Member

Thank you 🎉

foarsitter pushed a commit to foarsitter/cookiecutter-django that referenced this pull request Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Update Django] Django 5.1

3 participants