Upgrade libraries for Django 4.2 LTS compatibility#4
Open
Conversation
- Update Django from 1.4.16 to 4.2 LTS
- Replace django-social-auth with social-auth-app-django (social_django)
- Update INSTALLED_APPS: social_auth -> social_django
- Update AUTHENTICATION_BACKENDS: social_auth.backends.* -> social_core.backends.*
- Update settings to SOCIAL_AUTH_<PROVIDER>_KEY/SECRET naming convention
- Replace django-mediasync (abandoned) with django-storages for S3 support
- Bump django-taggit to >= 5.0
- Remove django-chunks (unmaintained, incompatible with modern Django)
- Modernize manage.py: replace execute_manager with execute_from_command_line
- Modernize urls.py: replace patterns()/url() with list/re_path()
- Modernize settings.default.py:
- Replace TEMPLATE_LOADERS/TEMPLATE_CONTEXT_PROCESSORS/TEMPLATE_DIRS with TEMPLATES
- Replace MIDDLEWARE_CLASSES with MIDDLEWARE
- Update context processor paths (django.core -> django.template)
- Remove deprecated ADMIN_MEDIA_PREFIX and TEMPLATE_DEBUG
- Add DEFAULT_AUTO_FIELD
- Fix Windows-style path separators
- Fix files.py: handle missing sys.argv gracefully
- Fix template {% url %} tag to use quoted names
- Update setup-virtualenv.sh to use python3 -m venv
Co-Authored-By: Oz <oz-agent@warp.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrade libraries for Django 4.2 LTS compatibility
This PR upgrades the project from Django 1.4 to Django 4.2 LTS and replaces all deprecated/abandoned libraries.
Dependency changes
django == 1.4.16django >= 4.2, < 5.0django-social-auth >= 0.6.4social-auth-app-django >= 5.0django-mediasync >= 2.2.0django-storages >= 1.14(mediasync is abandoned)django-taggit >= 0.9.3django-taggit >= 5.0django-chunks >= 0.1Code changes
manage.py: Replacedexecute_manager(removed in Django 1.6) withexecute_from_command_lineurls.py: Replaceddjango.conf.urls.defaults/patterns()/url()withdjango.urls/ list syntax /re_path()settings.default.py:TEMPLATE_LOADERS,TEMPLATE_CONTEXT_PROCESSORS,TEMPLATE_DIRS→ singleTEMPLATESdictMIDDLEWARE_CLASSES→MIDDLEWAREdjango.core.context_processors.*→django.template.context_processors.*)django-storagesS3 configsocial_auth→social_django, backend paths →social_core.backends.*DEFAULT_AUTO_FIELD, removedADMIN_MEDIA_PREFIXandTEMPLATE_DEBUG\\) toos.path.join()files.py: Fixedsys.argv[1]crash when imported as a moduletemplates/templates.html: Fixed{% url %}tag to use quoted view name (required since Django 1.5)setup-virtualenv.sh: Replaced external virtualenv download withpython3 -m venvNotes
django-chunkswas removed from requirements as it is unmaintained and incompatible with modern Django. The{% chunk %}template tags in templates will need a replacement (e.g.django-flatblocksor a custom template tag).mediasynctemplate tags ({% media_url %},{% css %},{% js %}) used in templates will need to be replaced with Django's{% static %}tag or equivalent.This PR was generated with Oz.