django

Loop in Field name

I am trying to define a class with its different fields please someone can help me loop on the index of the field so that it is clean ?
class Tabletarif (models.Model):
age_duree = models.CharField (max_length = 4)
U_20 = models.FloatField…

500 Internal server error "populate() isn’t reentrant"

I am having issues with deploying some recent work on a Django app to my server. On deployment, I updated a few pip modules, and there was also some restructuring of the directories. Once done, I restarted apache2, but was greated by the below error messages which proved unhelpful

[Thu May 13 13:12:09.846428 2021] [wsgi:error] [pid 8385:tid 140483483444992] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690] mod_wsgi (pid=8385): Target WSGI script '/var/www/stage.admin.agile.coop/web/mysite/wsgi.py' cannot be loaded as Python module. 
[Thu May 13 13:12:09.846751 2021] [wsgi:error] [pid 8385:tid 140483483444992] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690] mod_wsgi (pid=8385): Exception occurred processing WSGI script '/var/www/stage.admin.agile.coop/web/mysite/wsgi.py'. 
[Thu May 13 13:12:09.847024 2021] [wsgi:error] [pid 8385:tid 140483483444992] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690] Traceback (most recent call last): 
[Thu May 13 13:12:09.847174 2021] [wsgi:error] [pid 8385:tid 140483483444992] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]   File "/var/www/stage.admin.agile.coop/web/mysite/wsgi.py", line 16, in <module> 
[Thu May 13 13:12:09.847275 2021] [wsgi:error] [pid 8385:tid 140483483444992] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690] application = get_wsgi_application() 
[Thu May 13 13:12:09.847363 2021] [wsgi:error] [pid 8385:tid 140483483444992] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]   File "/var/www/stage.admin.agile.coop/venv/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application 
[Thu May 13 13:12:09.847460 2021] [wsgi:error] [pid 8385:tid 140483483444992] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]     django.setup(set_prefix=False) 
[Thu May 13 13:12:09.847561 2021] [wsgi:error] [pid 8385:tid 140483483444992] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]   File "/var/www/stage.admin.agile.coop/venv/lib/python3.6/site-packages/django/__init__.py", line 24, in setup 
[Thu May 13 13:12:09.847655 2021] [wsgi:error] [pid 8385:tid 140483483444992] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]     apps.populate(settings.INSTALLED_APPS) 
[Thu May 13 13:12:09.847755 2021] [wsgi:error] [pid 8385:tid 140483483444992] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]   File "/var/www/stage.admin.agile.coop/venv/lib/python3.6/site-packages/django/apps/registry.py", line 83, in populate 
[Thu May 13 13:12:09.847850 2021] [wsgi:error] [pid 8385:tid 140483483444992] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]     raise RuntimeError("populate() isn't reentrant.") 
[Thu May 13 13:12:09.847944 2021] [wsgi:error] [pid 8385:tid 140483483444992] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690] RuntimeError: populate() isn't reentrant. 
[Thu May 13 13:12:10.281512 2021] [wsgi:error] [pid 8385:tid 140483365897984] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690] mod_wsgi (pid=8385): Target WSGI script '/var/www/stage.admin.agile.coop/web/mysite/wsgi.py' cannot be loaded as Python module. 
[Thu May 13 13:12:10.281766 2021] [wsgi:error] [pid 8385:tid 140483365897984] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690] mod_wsgi (pid=8385): Exception occurred processing WSGI script '/var/www/stage.admin.agile.coop/web/mysite/wsgi.py'. 
[Thu May 13 13:12:10.282035 2021] [wsgi:error] [pid 8385:tid 140483365897984] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690] Traceback (most recent call last): 
[Thu May 13 13:12:10.282166 2021] [wsgi:error] [pid 8385:tid 140483365897984] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]   File "/var/www/stage.admin.agile.coop/web/mysite/wsgi.py", line 16, in <module> 
[Thu May 13 13:12:10.282266 2021] [wsgi:error] [pid 8385:tid 140483365897984] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690] application = get_wsgi_application() 
[Thu May 13 13:12:10.282360 2021] [wsgi:error] [pid 8385:tid 140483365897984] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]   File "/var/www/stage.admin.agile.coop/venv/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application 
[Thu May 13 13:12:10.282439 2021] [wsgi:error] [pid 8385:tid 140483365897984] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]     django.setup(set_prefix=False) 
[Thu May 13 13:12:10.282550 2021] [wsgi:error] [pid 8385:tid 140483365897984] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]   File "/var/www/stage.admin.agile.coop/venv/lib/python3.6/site-packages/django/__init__.py", line 24, in setup 
[Thu May 13 13:12:10.282626 2021] [wsgi:error] [pid 8385:tid 140483365897984] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]     apps.populate(settings.INSTALLED_APPS) 
[Thu May 13 13:12:10.282704 2021] [wsgi:error] [pid 8385:tid 140483365897984] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]   File "/var/www/stage.admin.agile.coop/venv/lib/python3.6/site-packages/django/apps/registry.py", line 83, in populate 
[Thu May 13 13:12:10.282791 2021] [wsgi:error] [pid 8385:tid 140483365897984] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690]     raise RuntimeError("populate() isn't reentrant.") [Thu May 13 13:12:10.282883 2021] [wsgi:error] [pid 8385:tid 140483365897984] [remote 2a02:c7f:6c19:2c00:4150:e3c6:fe11:d603:34690] RuntimeError: populate() isn't reentrant.

On getting this, I followed some of the debugging tips on posts such as Django stops working with RuntimeError: populate() isn’t reentrant which uncovered some modules to update in pip. Once done, those messages went away, but I still get this message.

Any further tips on how to debug this would be greatly received.

Dan