Parcourir la source

[Python/Django] Update Python version 3.12 (#9694)

rio il y a 5 mois
Parent
commit
a4f4da0998

+ 2 - 2
frameworks/Python/django/benchmark_config.json

@@ -17,7 +17,7 @@
       "flavor": "Python3",
       "orm": "Full",
       "platform": "WSGI",
-      "webserver": "Meinheld",
+      "webserver": "Gunicorn",
       "os": "Linux",
       "database_os": "Linux",
       "display_name": "Django",
@@ -77,7 +77,7 @@
       "flavor": "Python3",
       "orm": "Full",
       "platform": "WSGI",
-      "webserver": "Meinheld",
+      "webserver": "Gunicorn",
       "os": "Linux",
       "database_os": "Linux",
       "display_name": "Django [Postgres]",

+ 1 - 1
frameworks/Python/django/django-postgresql.dockerfile

@@ -1,4 +1,4 @@
-FROM python:3.9-bullseye
+FROM python:3.12-bullseye
 
 ADD ./ /django
 

+ 1 - 1
frameworks/Python/django/django.dockerfile

@@ -1,4 +1,4 @@
-FROM python:3.9-bullseye
+FROM python:3.12-bullseye
 
 ADD ./ /django
 

+ 2 - 14
frameworks/Python/django/gunicorn_conf.py

@@ -5,7 +5,7 @@ import sys
 _is_pypy = hasattr(sys, 'pypy_version_info')
 _is_travis = os.environ.get('TRAVIS') == 'true'
 
-workers = int(multiprocessing.cpu_count() * 2.5)
+workers = int(multiprocessing.cpu_count())
 if _is_travis:
     workers = 2
 
@@ -14,16 +14,4 @@ keepalive = 120
 errorlog = '-'
 pidfile = 'gunicorn.pid'
 pythonpath = 'hello'
-
-if _is_pypy:
-    worker_class = "sync"
-else:
-    worker_class = "meinheld.gmeinheld.MeinheldWorker"
-
-    def post_fork(server, worker):
-        import meinheld
-        import meinheld.server
-        import meinheld.patch
-        meinheld.server.set_access_logger(None)
-        meinheld.set_keepalive(keepalive)
-        meinheld.patch.patch_all()
+worker_class = 'sync'

+ 3 - 3
frameworks/Python/django/requirements-gunicorn.txt

@@ -1,4 +1,4 @@
 -r requirements.txt
-greenlet==0.4.17
-gunicorn==20.1.0
-meinheld==1.0.2
+greenlet==3.1.1
+gunicorn==21.2.0
+gevent==24.10.2

+ 4 - 5
frameworks/Python/django/requirements.txt

@@ -1,6 +1,5 @@
 Django==3.2.25
-mysqlclient==1.4.6
-psycopg2==2.9.6; implementation_name=='cpython'
-psycopg2cffi==2.9.0; implementation_name=='pypy'
-pytz==2020.4
-ujson==5.4.0
+mysqlclient==2.2.6
+psycopg2==2.9.9; implementation_name=='cpython'
+pytz==2023.2
+ujson==5.8.0