Update Django to 4.2 and Python to 3.9#1
Open
stripathi669 wants to merge 1 commit into
Open
Conversation
This update brings the application to a more modern stack with Long-Term Support (LTS) versions of Django and a recent Python version.
Key changes include:
- Upgraded Django from 1.11 to 4.2.x in `requirements.txt`.
- Replaced `django-celery` with the modern `celery[django]` package (Celery 5.3.x).
- Updated various dependencies in `requirements.txt` for compatibility.
- Specified Python 3.9 for the Elastic Beanstalk environment via a `runtime.txt` file.
- Addressed compatibility issues in Django settings:
- Updated Celery configuration (`CELERY_RESULT_BACKEND`, `CELERY_BEAT_SCHEDULER`).
- Added `django_celery_beat` and `django_celery_results` to `INSTALLED_APPS`.
- Updated `urls.py` to use `re_path` instead of `url`.
- Updated Celery app initialization in `_celery.py` and `__init__.py`.
- Made the `createsu` management command in Elastic Beanstalk configuration (`.ebextensions/03_django.config`) more robust by allowing it to fail without stopping deployment (e.g., if superuser already exists).
- Added basic unit tests:
- Test for admin login page accessibility.
- Tests for Celery task import, callability, and basic execution.
The `awsebcli` and some of its direct dependencies were kept at older versions due to difficulties in upgrading them alongside other changes. Further work may be needed to modernize those if required.
stripathi669
commented
Jun 6, 2025
| leader_only: true | ||
| 02_createsu: | ||
| command: "manage.py createsu" | ||
| command: "python manage.py createsu || true" |
Contributor
Author
There was a problem hiding this comment.
don't change this
stripathi669
commented
Jun 6, 2025
| @@ -0,0 +1,65 @@ | |||
| from django.test import TestCase, Client | |||
| from django.urls import reverse | |||
Contributor
Author
There was a problem hiding this comment.
remove test file
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.
This update brings the application to a more modern stack with Long-Term Support (LTS) versions of Django and a recent Python version.
Key changes include:
requirements.txt.django-celerywith the moderncelery[django]package (Celery 5.3.x).requirements.txtfor compatibility.runtime.txtfile.CELERY_RESULT_BACKEND,CELERY_BEAT_SCHEDULER).django_celery_beatanddjango_celery_resultstoINSTALLED_APPS.urls.pyto usere_pathinstead ofurl._celery.pyand__init__.py.createsumanagement command in Elastic Beanstalk configuration (.ebextensions/03_django.config) more robust by allowing it to fail without stopping deployment (e.g., if superuser already exists).The
awsebcliand some of its direct dependencies were kept at older versions due to difficulties in upgrading them alongside other changes. Further work may be needed to modernize those if required.