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

[PROD] Django upgrade to 4.2 #1990

Closed
szabozoltan69 opened this issue Jan 9, 2024 · 4 comments
Closed

[PROD] Django upgrade to 4.2 #1990

szabozoltan69 opened this issue Jan 9, 2024 · 4 comments
Assignees

Comments

@szabozoltan69
Copy link
Contributor

Issue

According to https://endoflife.date/django the end of support of the recent 3.2 Django LTS version is in April 2024.
So (if possible, in March) we should upgrade to Django 4.2 LTS.
@batpad @thenav56 @k9845

@szabozoltan69 szabozoltan69 self-assigned this Jan 9, 2024
@szabozoltan69
Copy link
Contributor Author

szabozoltan69 commented Feb 6, 2024

Useful source: https://www.freecodecamp.org/news/importerror-cannot-import-name-force-text-from-django-utils-encoding-python-error-solved/
(force_text -> force_str, also smart_text -> smart_str)
Requires also python 3.9 instead of 3.8.
For local database a minimum of postgres 12.
Also the snapshot tests need some refresh.

@szabozoltan69
Copy link
Contributor Author

-python = "^3.8"
+python = "^3.9"

-Django = ">=3.2,<3.3"
+Django = ">=4.2,<5.0"

-django-reversion-compare = "==0.9.0"
+django-reversion-compare = "==0.16.2"

-django-reversion = "==3.0.5"
+django-reversion = "==5.0.12"

-django-tinymce4-lite = "==1.7.4"
+django-tinymce = "==3.7.1"

-djangorestframework = "==3.11.2"
+djangorestframework = "==3.14.0"

@szabozoltan69
Copy link
Contributor Author

pip list|grep jango
Django                            4.2.10
django-admin-autocomplete-filter  0.7.1
django-admin-list-filter-dropdown 1.0.3
django-cors-headers               3.11.0
django-coverage                   1.2.4
django-debug-toolbar              4.1.0
django-enumfield                  2.0.2
django-environ                    0.8.1
django-extensions                 2.0.6
django-filter                     2.4.0
django-guardian                   2.4.0
django-haystack                   3.2.1
django-modeltranslation           0.17.5
django-read-only                  1.12.0
django-redis                      5.0.0
django-reversion                  5.0.12
django-reversion-compare          0.16.2
django-storages                   1.11.1
django-stubs                      4.2.7
django-stubs-ext                  4.2.7
django-tinymce                    3.7.1
djangorestframework               3.14.0
djangorestframework-camel-case    1.2.0
djangorestframework-csv           2.1.1
djangorestframework-guardian      0.1.1
graphene-django                   2.16.0
opencensus-ext-django             0.7.4
pytest-django                     4.8.0

@szabozoltan69
Copy link
Contributor Author

szabozoltan69 commented Feb 14, 2024

On developer side this change will require a database reload, due to we must shift to Postgresql 12.
So, from the db container: the old db can be dumped like this:

pg_dump -O    -c --if-exists -h 127.0.0.1 -U test test > /tmp/testdump.sql

Then the load to the new db can be done via a simple

\i ...testdump.sql

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

No branches or pull requests

2 participants