Migration to Python 3 and Django 5 #320
Open
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.
Big code refactoring to update dependencies. #160
This work was motivated by the difficulties of setting up Python 2.7 and Django 1.9 apps on modern environments. Mainly due to trusted repositories not shipping old versions, and modern versions occupying the expected installation paths and binary names.
Overview of the changes made:
python:3, and installing dependencies directly fromrequirements.txtdjango-solo-grappelliwas replaced by the up to datedjango-solo.django-loginaswas removed due to not being compatible with recent python versions, and I couldn't see the value of this functionality. If required we can replace it with modern solutions for this same feature..was prepended whenever was required.on_deleteargument is required for ForeignKey fields. For all instances it was usedon_delete=models.CASCADE, to comply with the previous behaviour.printstatements where updated accordingly__unicode__replaced with__str__mapfunctions were wrapped withlist, so that it complies with the expected behaviour from python2.{% load staticfiles %}replaced by{% load static %}urlcalls replaced withre_path.MiddlewareMixinadded onURLLocaleMiddlewareto replicate how previous Django versions called middlewaresMIDDLEWARE_CLASSESreplaced withMIDDLEWAREonsettings.pyDEFAULT_AUTO_FIELD='django.db.models.AutoField'used to replicate the old default type for primary keysA manual sqlite command was run to remove non corresponding foreign keys
that was causing migration error: