From 67fb468555bc4816ea1dfe7cf0807c13cea3cb2f Mon Sep 17 00:00:00 2001 From: Halidu Abubakar Date: Wed, 15 Nov 2023 22:19:24 +0000 Subject: [PATCH] Upgrade Django for Invest-PIR-API --- .gitignore | 1 - config/settings/__init__.py | 2 +- config/wsgi.py | 2 - makefile | 4 +- requirements.in | 42 ++++++------ requirements.txt | 125 ++++++++++++++++++++++-------------- requirements_test.txt | 36 +++++++---- 7 files changed, 122 insertions(+), 90 deletions(-) diff --git a/.gitignore b/.gitignore index b15e28d..87a497f 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,6 @@ var/ *.egg-info/ .installed.cfg *.egg - # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. diff --git a/config/settings/__init__.py b/config/settings/__init__.py index acefb7a..edfb7a3 100644 --- a/config/settings/__init__.py +++ b/config/settings/__init__.py @@ -352,7 +352,7 @@ LOGIN_URL = reverse_lazy('authbroker_client:login') LOGIN_REDIRECT_URL = reverse_lazy('admin:index') - # authbroker config +# authbroker config AUTHBROKER_URL = env.str('STAFF_SSO_AUTHBROKER_URL') AUTHBROKER_CLIENT_ID = env.str('AUTHBROKER_CLIENT_ID') AUTHBROKER_CLIENT_SECRET = env.str('AUTHBROKER_CLIENT_SECRET') diff --git a/config/wsgi.py b/config/wsgi.py index fbfe837..a0e80ca 100644 --- a/config/wsgi.py +++ b/config/wsgi.py @@ -10,9 +10,7 @@ import os from django.core.wsgi import get_wsgi_application -from whitenoise.django import DjangoWhiteNoise os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") application = get_wsgi_application() -application = DjangoWhiteNoise(application) diff --git a/makefile b/makefile index 9e04bbd..24a7cd1 100644 --- a/makefile +++ b/makefile @@ -155,10 +155,10 @@ debug_shell: debug: test_requirements debug_test compile_requirements: - PIP_CONSTRAINT=cython_constraint.txt python -m piptools compile requirements.in + python -m piptools compile requirements.in compile_test_requirements: - PIP_CONSTRAINT=cython_constraint.txt python -m piptools compile requirements_test.in + python -m piptools compile requirements_test.in compile_all_requirements: compile_requirements && compile_test_requirements diff --git a/requirements.in b/requirements.in index 7d7698f..2af04ba 100644 --- a/requirements.in +++ b/requirements.in @@ -1,42 +1,42 @@ boto3==1.17.* botocore==1.20.* dj-database-url==0.4.2 -django==2.2.28 -django-amazon-ses==4.0.0 -django-clear-cache==0.3 -django-crispy-forms==1.7.1 -django_recaptcha==3.0.0 -django-redis==4.8.0 -django-storages==1.12.3 -django-modeltranslation==0.13.1 +django==3.2.23 +django-amazon-ses>=4.0.0 +django-clear-cache>=0.3 +django-crispy-forms==2.0 +django_recaptcha>=3.0.0 +django-redis==5.4.0 +django-storages>=1.14.2 +django-modeltranslation>=0.18.10 dj-database-url==0.4.2 -drf-spectacular==0.26.* +drf-spectacular>=0.26.* gunicorn==19.7.1 pillow==10.0.1 waitress==2.1.2 psycopg2-binary==2.8.6 pytz==2021.3 raven==6.5.0 -whitenoise==3.3.1 +whitenoise==6.6.0 zenpy==1.1.10 kombu<6.0,>=5.2.3 celery[redis]>=5.2.2 -directory-validators>=8.0.1 +directory-validators>=9.3.1 # Pinned at this commit as includes vital model import logic fix. # Should be merged in 0.5.1 -django-modelcluster==6.0 -django-taggit==1.0.* -djangorestframework==3.12.4 +django-modelcluster>=6.0 +django-taggit>=1.0.* +djangorestframework>=3.12.4 sorl-thumbnail==12.9.0 -django-countries==5.2 -django-countries-plus==2.1.0 +django-countries>=7.5.1 +django-countries-plus>=2.1.0 notifications-python-client==6.3.* weasyprint==52.5 PyPDF2==1.27.9 -sigauth==4.3.0 +sigauth>=4.3.0 bs4 raven -django-axes==4.4.0 +django-axes>=6.1.1 requests[security]==2.31.0 pyyaml==6.0.0 django-environ==0.4.5 @@ -45,9 +45,9 @@ cryptography==41.0.4 urllib3>=1.26.18 # Latest django-moderation release(0.0.7) package has restriction for django upto 2.2 and we wanted to install # django 2.2.24 for critical vulnerabilities - hence installing from master -django-moderation==0.8.0 -django-markdownx==3.0.1 +django-moderation>=0.8.0 +django-markdownx>=3.0.1 Pyjwt==2.4.0 -django-staff-sso-client==3.1.1 +django-staff-sso-client>=3.1.1 certifi==2023.7.22 sqlparse>=0.4.4 diff --git a/requirements.txt b/requirements.txt index 5758976..6f01e74 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,15 +4,21 @@ # # pip-compile requirements.in # -amqp==5.0.9 +amqp==5.2.0 # via kombu -async-timeout==4.0.2 +asgiref==3.7.2 + # via + # django + # django-countries +async-timeout==4.0.3 # via redis attrs==23.1.0 - # via jsonschema -beautifulsoup4==4.6.0 + # via + # jsonschema + # referencing +beautifulsoup4==4.12.2 # via bs4 -billiard==3.6.4.0 +billiard==4.2.0 # via celery boto3==1.17.112 # via @@ -25,7 +31,7 @@ botocore==1.20.112 # s3transfer bs4==0.0.1 # via -r requirements.in -cachetools==2.0.1 +cachetools==5.3.2 # via zenpy cairocffi==1.6.1 # via @@ -33,7 +39,7 @@ cairocffi==1.6.1 # weasyprint cairosvg==2.7.1 # via weasyprint -celery[redis]==5.2.3 +celery[redis]==5.3.5 # via # -r requirements.in # celery @@ -41,48 +47,52 @@ certifi==2023.7.22 # via # -r requirements.in # requests -cffi==1.14.5 +cffi==1.16.0 # via # cairocffi # cryptography # weasyprint -charset-normalizer==3.0.1 +charset-normalizer==3.3.2 # via requests -click==8.0.3 +click==8.1.7 # via # celery # click-didyoumean # click-plugins # click-repl -click-didyoumean==0.0.3 +click-didyoumean==0.3.0 # via celery click-plugins==1.1.1 # via celery -click-repl==0.2.0 +click-repl==0.3.0 # via celery cryptography==41.0.4 # via -r requirements.in -cssselect2==0.2.1 +cssselect2==0.7.0 # via # cairosvg # weasyprint defusedxml==0.7.1 # via cairosvg -directory-validators==8.0.1 +directory-validators==9.3.1 # via -r requirements.in dj-database-url==0.4.2 # via -r requirements.in -django==2.2.28 +django==3.2.23 # via # -r requirements.in # directory-validators # django-amazon-ses + # django-axes # django-clear-cache # django-countries-plus + # django-crispy-forms # django-markdownx # django-modelcluster + # django-modeltranslation # django-moderation # django-recaptcha + # django-redis # django-staff-sso-client # django-storages # django-taggit @@ -91,37 +101,33 @@ django==2.2.28 # sigauth django-amazon-ses==4.0.0 # via -r requirements.in -django-appconf==1.0.2 - # via django-axes -django-axes==4.4.0 +django-axes==6.1.1 # via -r requirements.in django-clear-cache==0.3 # via -r requirements.in -django-countries==5.2 +django-countries==7.5.1 # via -r requirements.in django-countries-plus==2.1.0 # via -r requirements.in -django-crispy-forms==1.7.1 +django-crispy-forms==2.0 # via -r requirements.in django-environ==0.4.5 # via -r requirements.in -django-ipware==2.1.0 - # via django-axes django-markdownx==3.0.1 # via -r requirements.in django-modelcluster==6.0 # via -r requirements.in -django-modeltranslation==0.13.1 +django-modeltranslation==0.18.11 # via -r requirements.in django-moderation==0.8.0 # via -r requirements.in django-recaptcha==3.0.0 # via -r requirements.in -django-redis==4.8.0 +django-redis==5.4.0 # via -r requirements.in django-staff-sso-client==3.1.1 # via -r requirements.in -django-storages==1.12.3 +django-storages==1.14.2 # via -r requirements.in django-taggit==1.0.0 # via -r requirements.in @@ -132,27 +138,31 @@ djangorestframework==3.12.4 # sigauth docopt==0.6.2 # via notifications-python-client -drf-spectacular==0.26.2 +drf-spectacular==0.26.5 # via -r requirements.in gunicorn==19.7.1 # via -r requirements.in -html5lib==1.0.1 +html5lib==1.1 # via weasyprint -idna==2.6 +idna==3.4 # via requests +importlib-metadata==6.8.0 + # via markdown inflection==0.5.1 # via drf-spectacular -jmespath==0.9.3 +jmespath==0.10.0 # via # boto3 # botocore -jsonschema==4.17.3 +jsonschema==4.19.2 # via drf-spectacular -kombu==5.2.3 +jsonschema-specifications==2023.11.1 + # via jsonschema +kombu==5.3.3 # via # -r requirements.in # celery -markdown==3.3.4 +markdown==3.5.1 # via django-markdownx mohawk==1.1.0 # via sigauth @@ -162,7 +172,7 @@ oauthlib==3.2.2 # via # -r requirements.in # requests-oauthlib -olefile==0.44 +olefile==0.46 # via directory-validators pillow==10.0.1 # via @@ -171,11 +181,11 @@ pillow==10.0.1 # directory-validators # django-markdownx # weasyprint -prompt-toolkit==3.0.19 +prompt-toolkit==3.0.41 # via click-repl psycopg2-binary==2.8.6 # via -r requirements.in -pycparser==2.18 +pycparser==2.21 # via cffi pyjwt==2.4.0 # via @@ -183,21 +193,18 @@ pyjwt==2.4.0 # notifications-python-client pypdf2==1.27.9 # via -r requirements.in -pyphen==0.9.4 +pyphen==0.14.0 # via weasyprint -pyrsistent==0.19.3 - # via jsonschema -python-dateutil==2.6.1 +python-dateutil==2.8.2 # via # botocore + # celery # zenpy pytz==2021.3 # via # -r requirements.in - # celery # directory-validators # django - # django-axes # django-modelcluster pyyaml==6.0 # via @@ -205,10 +212,14 @@ pyyaml==6.0 # drf-spectacular raven==6.5.0 # via -r requirements.in -redis==4.4.4 +redis==5.0.1 # via # celery # django-redis +referencing==0.31.0 + # via + # jsonschema + # jsonschema-specifications requests[security]==2.31.0 # via # -r requirements.in @@ -217,29 +228,42 @@ requests[security]==2.31.0 # requests # requests-oauthlib # zenpy -requests-oauthlib==1.3.0 +requests-oauthlib==1.3.1 # via django-staff-sso-client +rpds-py==0.12.0 + # via + # jsonschema + # referencing s3transfer==0.4.2 # via boto3 sigauth==4.3.0 # via -r requirements.in -six==1.11.0 +six==1.16.0 # via - # click-repl # html5lib # mohawk # python-dateutil sorl-thumbnail==12.9.0 # via -r requirements.in +soupsieve==2.5 + # via beautifulsoup4 sqlparse==0.4.4 # via # -r requirements.in # django -tinycss2==1.1.0 +tinycss2==1.2.1 # via # cairosvg # cssselect2 # weasyprint +typing-extensions==4.8.0 + # via + # asgiref + # django-countries + # django-modeltranslation + # kombu +tzdata==2023.3 + # via celery uritemplate==4.1.1 # via drf-spectacular urllib3==1.26.18 @@ -248,25 +272,28 @@ urllib3==1.26.18 # botocore # directory-validators # requests -vine==5.0.0 +vine==5.1.0 # via # amqp # celery # kombu waitress==2.1.2 # via -r requirements.in -wcwidth==0.2.5 +wcwidth==0.2.10 # via prompt-toolkit weasyprint==52.5 # via -r requirements.in webencodings==0.5.1 # via + # cssselect2 # html5lib # tinycss2 -whitenoise==3.3.1 +whitenoise==6.6.0 # via -r requirements.in zenpy==1.1.10 # via -r requirements.in +zipp==3.17.0 + # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/requirements_test.txt b/requirements_test.txt index 6258ac5..2a7f926 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -6,6 +6,10 @@ # amqp==5.0.9 # via kombu +asgiref==3.7.2 + # via + # django + # django-countries async-timeout==4.0.2 # via redis attrs==23.1.0 @@ -79,21 +83,25 @@ cssselect2==0.2.1 # weasyprint defusedxml==0.7.1 # via cairosvg -directory-validators==8.0.1 +directory-validators==9.3.1 # via -r requirements.in dj-database-url==0.4.2 # via -r requirements.in -django==2.2.28 +django==3.2.23 # via # -r requirements.in # directory-validators # django-amazon-ses + # django-axes # django-clear-cache # django-countries-plus + # django-crispy-forms # django-markdownx # django-modelcluster + # django-modeltranslation # django-moderation # django-recaptcha + # django-redis # django-staff-sso-client # django-storages # django-taggit @@ -102,37 +110,33 @@ django==2.2.28 # sigauth django-amazon-ses==4.0.0 # via -r requirements.in -django-appconf==1.0.2 - # via django-axes -django-axes==4.4.0 +django-axes==6.1.1 # via -r requirements.in django-clear-cache==0.3 # via -r requirements.in -django-countries==5.2 +django-countries==7.5.1 # via -r requirements.in django-countries-plus==2.1.0 # via -r requirements.in -django-crispy-forms==1.7.1 +django-crispy-forms==2.0 # via -r requirements.in django-environ==0.4.5 # via -r requirements.in -django-ipware==2.1.0 - # via django-axes django-markdownx==3.0.1 # via -r requirements.in django-modelcluster==6.0 # via -r requirements.in -django-modeltranslation==0.13.1 +django-modeltranslation==0.18.11 # via -r requirements.in django-moderation==0.8.0 # via -r requirements.in django-recaptcha==3.0.0 # via -r requirements.in -django-redis==4.8.0 +django-redis==5.4.0 # via -r requirements.in django-staff-sso-client==3.1.1 # via -r requirements.in -django-storages==1.12.3 +django-storages==1.14.2 # via -r requirements.in django-taggit==1.0.0 # via -r requirements.in @@ -261,7 +265,6 @@ pytz==2021.3 # celery # directory-validators # django - # django-axes # django-modelcluster pyyaml==6.0 # via @@ -318,6 +321,11 @@ tomli==2.0.1 # via # coverage # pytest +typing-extensions==4.8.0 + # via + # asgiref + # django-countries + # django-modeltranslation uritemplate==4.1.1 # via drf-spectacular urllib3==1.26.18 @@ -346,7 +354,7 @@ werkzeug==3.0.1 # via # -r requirements_test.in # moto -whitenoise==3.3.1 +whitenoise==6.6.0 # via -r requirements.in xmltodict==0.11.0 # via moto