How to fix 502 error when deploying django project as a zip file using elastic beanstalk

I am trying to deploy a Django project as a zip file using ElasticBeanstalk. But I don’t know what I am doing wrong. It is a very simple Django project. My file/directory structure for the project is this:

The files that are included in the zip file I upload are all the directories/files in MEMBERS/forening.

django.config contains:

option_settings:
  aws:elasticbeanstalk:container:python:
    WSGIPath: forening.wsgi:application

requirements.txt contains the output of the command python3 -m pip freeze which is:

asgiref==3.7.2
Django==4.2.8
gunicorn==21.2.0
sqlparse==0.4.4
typing-extensions==4.9.0

The IAM role I use has permission to AWSElasticBeanstalkMulticontainerDocker, AWSElasticBeanstalkWebTier, and AWSElasticBeanstalkWorkerTier.

Below is my web-stdout.log :

Jan  1 17:25:54 ip-172-31-41-169 web[2130]: [2024-01-01 17:25:54 +0000] [2130] [INFO] Starting gunicorn 21.2.0
Jan  1 17:25:54 ip-172-31-41-169 web[2130]: [2024-01-01 17:25:54 +0000] [2130] [INFO] Listening at: http://127.0.0.1:8000 (2130)
Jan  1 17:25:54 ip-172-31-41-169 web[2130]: [2024-01-01 17:25:54 +0000] [2130] [INFO] Using worker: gthread
Jan  1 17:25:54 ip-172-31-41-169 web[2138]: [2024-01-01 17:25:54 +0000] [2138] [INFO] Booting worker with pid: 2138
Jan  1 17:25:55 ip-172-31-41-169 web[2138]: [2024-01-01 17:25:55 +0000] [2138] [ERROR] Exception in worker process
Jan  1 17:25:55 ip-172-31-41-169 web[2138]: Traceback (most recent call last):
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:    worker.init_process()
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/gthread.py", line 95, in init_process
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:    super().init_process()
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:    self.load_wsgi()
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:    self.wsgi = self.app.wsgi()
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:    self.callable = self.load()
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:    return self.load_wsgiapp()
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:    return util.import_app(self.app_uri)
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/util.py", line 371, in import_app
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:    mod = importlib.import_module(module)
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:    return _bootstrap._gcd_import(name[level:], package, level)
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
Jan  1 17:25:55 ip-172-31-41-169 web[2138]:  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
Jan  1 17:25:55 ip-172-31-41-169 web[2138]: ModuleNotFoundError: No module named 'application'
Jan  1 17:25:55 ip-172-31-41-169 web[2138]: [2024-01-01 17:25:55 +0000] [2138] [INFO] Worker exiting (pid: 2138)
Jan  1 17:25:55 ip-172-31-41-169 web[2130]: [2024-01-01 17:25:55 +0000] [2130] [ERROR] Worker (pid:2138) exited with code 3
Jan  1 17:25:55 ip-172-31-41-169 web[2130]: [2024-01-01 17:25:55 +0000] [2130] [ERROR] Shutting down: Master
Jan  1 17:25:55 ip-172-31-41-169 web[2130]: [2024-01-01 17:25:55 +0000] [2130] [ERROR] Reason: Worker failed to boot.
Jan  1 17:25:55 ip-172-31-41-169 web[2177]: [2024-01-01 17:25:55 +0000] [2177] [INFO] Starting gunicorn 21.2.0
Jan  1 17:25:55 ip-172-31-41-169 web[2177]: [2024-01-01 17:25:55 +0000] [2177] [INFO] Listening at: http://127.0.0.1:8000 (2177)
Jan  1 17:25:55 ip-172-31-41-169 web[2177]: [2024-01-01 17:25:55 +0000] [2177] [INFO] Using worker: gthread
Jan  1 17:25:55 ip-172-31-41-169 web[2189]: [2024-01-01 17:25:55 +0000] [2189] [INFO] Booting worker with pid: 2189
Jan  1 17:25:55 ip-172-31-41-169 web[2189]: [2024-01-01 17:25:55 +0000] [2189] [ERROR] Exception in worker process
Jan  1 17:25:55 ip-172-31-41-169 web[2189]: Traceback (most recent call last):
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:    worker.init_process()
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/gthread.py", line 95, in init_process
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:    super().init_process()
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:    self.load_wsgi()
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:    self.wsgi = self.app.wsgi()
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:    self.callable = self.load()
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:    return self.load_wsgiapp()
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:    return util.import_app(self.app_uri)
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/util.py", line 371, in import_app
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:    mod = importlib.import_module(module)
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:    return _bootstrap._gcd_import(name[level:], package, level)
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
Jan  1 17:25:55 ip-172-31-41-169 web[2189]:  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
Jan  1 17:25:55 ip-172-31-41-169 web[2189]: ModuleNotFoundError: No module named 'application'
Jan  1 17:25:55 ip-172-31-41-169 web[2189]: [2024-01-01 17:25:55 +0000] [2189] [INFO] Worker exiting (pid: 2189)
Jan  1 17:25:55 ip-172-31-41-169 web[2177]: [2024-01-01 17:25:55 +0000] [2177] [ERROR] Worker (pid:2189) exited with code 3
Jan  1 17:25:55 ip-172-31-41-169 web[2177]: [2024-01-01 17:25:55 +0000] [2177] [ERROR] Shutting down: Master
Jan  1 17:25:55 ip-172-31-41-169 web[2177]: [2024-01-01 17:25:55 +0000] [2177] [ERROR] Reason: Worker failed to boot.
Jan  1 17:25:55 ip-172-31-41-169 web[2193]: [2024-01-01 17:25:55 +0000] [2193] [INFO] Starting gunicorn 21.2.0
Jan  1 17:25:55 ip-172-31-41-169 web[2193]: [2024-01-01 17:25:55 +0000] [2193] [INFO] Listening at: http://127.0.0.1:8000 (2193)
Jan  1 17:25:55 ip-172-31-41-169 web[2193]: [2024-01-01 17:25:55 +0000] [2193] [INFO] Using worker: gthread
Jan  1 17:25:55 ip-172-31-41-169 web[2197]: [2024-01-01 17:25:55 +0000] [2197] [INFO] Booting worker with pid: 2197
Jan  1 17:25:55 ip-172-31-41-169 web[2197]: [2024-01-01 17:25:55 +0000] [2197] [ERROR] Exception in worker process
Jan  1 17:25:55 ip-172-31-41-169 web[2197]: Traceback (most recent call last):
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:    worker.init_process()
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/gthread.py", line 95, in init_process
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:    super().init_process()
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:    self.load_wsgi()
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:    self.wsgi = self.app.wsgi()
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:    self.callable = self.load()
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:    return self.load_wsgiapp()
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:    return util.import_app(self.app_uri)
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/util.py", line 371, in import_app
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:    mod = importlib.import_module(module)
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:    return _bootstrap._gcd_import(name[level:], package, level)
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
Jan  1 17:25:55 ip-172-31-41-169 web[2197]:  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
Jan  1 17:25:55 ip-172-31-41-169 web[2197]: ModuleNotFoundError: No module named 'application'
Jan  1 17:25:55 ip-172-31-41-169 web[2197]: [2024-01-01 17:25:55 +0000] [2197] [INFO] Worker exiting (pid: 2197)
Jan  1 17:25:56 ip-172-31-41-169 web[2193]: [2024-01-01 17:25:56 +0000] [2193] [ERROR] Worker (pid:2197) exited with code 3
Jan  1 17:25:56 ip-172-31-41-169 web[2193]: [2024-01-01 17:25:56 +0000] [2193] [ERROR] Shutting down: Master
Jan  1 17:25:56 ip-172-31-41-169 web[2193]: [2024-01-01 17:25:56 +0000] [2193] [ERROR] Reason: Worker failed to boot.
Jan  1 17:25:56 ip-172-31-41-169 web[2199]: [2024-01-01 17:25:56 +0000] [2199] [INFO] Starting gunicorn 21.2.0
Jan  1 17:25:56 ip-172-31-41-169 web[2199]: [2024-01-01 17:25:56 +0000] [2199] [INFO] Listening at: http://127.0.0.1:8000 (2199)
Jan  1 17:25:56 ip-172-31-41-169 web[2199]: [2024-01-01 17:25:56 +0000] [2199] [INFO] Using worker: gthread
Jan  1 17:25:56 ip-172-31-41-169 web[2203]: [2024-01-01 17:25:56 +0000] [2203] [INFO] Booting worker with pid: 2203
Jan  1 17:25:56 ip-172-31-41-169 web[2203]: [2024-01-01 17:25:56 +0000] [2203] [ERROR] Exception in worker process
Jan  1 17:25:56 ip-172-31-41-169 web[2203]: Traceback (most recent call last):
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:    worker.init_process()
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/gthread.py", line 95, in init_process
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:    super().init_process()
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:    self.load_wsgi()
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:    self.wsgi = self.app.wsgi()
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:    self.callable = self.load()
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:    return self.load_wsgiapp()
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:    return util.import_app(self.app_uri)
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/util.py", line 371, in import_app
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:    mod = importlib.import_module(module)
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:    return _bootstrap._gcd_import(name[level:], package, level)
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
Jan  1 17:25:56 ip-172-31-41-169 web[2203]:  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
Jan  1 17:25:56 ip-172-31-41-169 web[2203]: ModuleNotFoundError: No module named 'application'
Jan  1 17:25:56 ip-172-31-41-169 web[2203]: [2024-01-01 17:25:56 +0000] [2203] [INFO] Worker exiting (pid: 2203)
Jan  1 17:25:56 ip-172-31-41-169 web[2199]: [2024-01-01 17:25:56 +0000] [2199] [ERROR] Worker (pid:2203) exited with code 3
Jan  1 17:25:56 ip-172-31-41-169 web[2199]: [2024-01-01 17:25:56 +0000] [2199] [ERROR] Shutting down: Master
Jan  1 17:25:56 ip-172-31-41-169 web[2199]: [2024-01-01 17:25:56 +0000] [2199] [ERROR] Reason: Worker failed to boot.
Jan  1 17:25:56 ip-172-31-41-169 web[2205]: [2024-01-01 17:25:56 +0000] [2205] [INFO] Starting gunicorn 21.2.0
Jan  1 17:25:56 ip-172-31-41-169 web[2205]: [2024-01-01 17:25:56 +0000] [2205] [INFO] Listening at: http://127.0.0.1:8000 (2205)
Jan  1 17:25:56 ip-172-31-41-169 web[2205]: [2024-01-01 17:25:56 +0000] [2205] [INFO] Using worker: gthread
Jan  1 17:25:56 ip-172-31-41-169 web[2209]: [2024-01-01 17:25:56 +0000] [2209] [INFO] Booting worker with pid: 2209
Jan  1 17:25:56 ip-172-31-41-169 web[2209]: [2024-01-01 17:25:56 +0000] [2209] [ERROR] Exception in worker process
Jan  1 17:25:56 ip-172-31-41-169 web[2209]: Traceback (most recent call last):
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:    worker.init_process()
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/gthread.py", line 95, in init_process
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:    super().init_process()
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:    self.load_wsgi()
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:    self.wsgi = self.app.wsgi()
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:    self.callable = self.load()
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:    return self.load_wsgiapp()
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:    return util.import_app(self.app_uri)
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/util.py", line 371, in import_app
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:    mod = importlib.import_module(module)
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:    return _bootstrap._gcd_import(name[level:], package, level)
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
Jan  1 17:25:56 ip-172-31-41-169 web[2209]:  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
Jan  1 17:25:56 ip-172-31-41-169 web[2209]: ModuleNotFoundError: No module named 'application'
Jan  1 17:25:56 ip-172-31-41-169 web[2209]: [2024-01-01 17:25:56 +0000] [2209] [INFO] Worker exiting (pid: 2209)
Jan  1 17:25:56 ip-172-31-41-169 web[2205]: [2024-01-01 17:25:56 +0000] [2205] [ERROR] Worker (pid:2209) exited with code 3
Jan  1 17:25:56 ip-172-31-41-169 web[2205]: [2024-01-01 17:25:56 +0000] [2205] [ERROR] Shutting down: Master
Jan  1 17:25:56 ip-172-31-41-169 web[2205]: [2024-01-01 17:25:56 +0000] [2205] [ERROR] Reason: Worker failed to boot.
Jan  1 17:25:57 ip-172-31-41-169 web[2211]: [2024-01-01 17:25:57 +0000] [2211] [INFO] Starting gunicorn 21.2.0
Jan  1 17:25:57 ip-172-31-41-169 web[2211]: [2024-01-01 17:25:57 +0000] [2211] [INFO] Listening at: http://127.0.0.1:8000 (2211)
Jan  1 17:25:57 ip-172-31-41-169 web[2211]: [2024-01-01 17:25:57 +0000] [2211] [INFO] Using worker: gthread
Jan  1 17:25:57 ip-172-31-41-169 web[2215]: [2024-01-01 17:25:57 +0000] [2215] [INFO] Booting worker with pid: 2215
Jan  1 17:25:57 ip-172-31-41-169 web[2215]: [2024-01-01 17:25:57 +0000] [2215] [ERROR] Exception in worker process
Jan  1 17:25:57 ip-172-31-41-169 web[2215]: Traceback (most recent call last):
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:    worker.init_process()
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/gthread.py", line 95, in init_process
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:    super().init_process()
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:    self.load_wsgi()
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:    self.wsgi = self.app.wsgi()
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:    self.callable = self.load()
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:    return self.load_wsgiapp()
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:    return util.import_app(self.app_uri)
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:  File "/var/app/venv/staging-LQM1lest/lib64/python3.9/site-packages/gunicorn/util.py", line 371, in import_app
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:    mod = importlib.import_module(module)
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:    return _bootstrap._gcd_import(name[level:], package, level)
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
Jan  1 17:25:57 ip-172-31-41-169 web[2215]:  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
Jan  1 17:25:57 ip-172-31-41-169 web[2215]: ModuleNotFoundError: No module named 'application'
Jan  1 17:25:57 ip-172-31-41-169 web[2215]: [2024-01-01 17:25:57 +0000] [2215] [INFO] Worker exiting (pid: 2215)
Jan  1 17:25:57 ip-172-31-41-169 web[2211]: [2024-01-01 17:25:57 +0000] [2211] [ERROR] Worker (pid:2215) exited with code 3
Jan  1 17:25:57 ip-172-31-41-169 web[2211]: [2024-01-01 17:25:57 +0000] [2211] [ERROR] Shutting down: Master
Jan  1 17:25:57 ip-172-31-41-169 web[2211]: [2024-01-01 17:25:57 +0000] [2211] [ERROR] Reason: Worker failed to boot.

I don’t really know what I am doing wrong. When I run a server locally on my computer using python3 manage.py runserver, then the server runs well but it doesn’t work when I try to deploy on Elastic Beanstalk with a zip file.

EDIT:

Adding more logs

cfn-init.log:

2024-01-01 17:25:04,925 [INFO] -----------------------Starting build-----------------------
2024-01-01 17:25:04,937 [INFO] Running configSets: _OnInstanceBoot
2024-01-01 17:25:04,940 [INFO] Running configSet _OnInstanceBoot
2024-01-01 17:25:04,947 [INFO] Running config AWSEBBaseConfig
2024-01-01 17:25:05,603 [INFO] Command clearbackupfiles succeeded
2024-01-01 17:25:05,607 [INFO] Running config AWSEBCfnHupEndpointOverride
2024-01-01 17:25:05,616 [INFO] Command clearbackupfiles succeeded
2024-01-01 17:25:05,617 [INFO] ConfigSets completed
2024-01-01 17:25:05,618 [INFO] -----------------------Build complete-----------------------
2024-01-01 17:25:47,131 [INFO] -----------------------Starting build-----------------------
2024-01-01 17:25:47,136 [INFO] Running configSets: Infra-EmbeddedPreBuild
2024-01-01 17:25:47,137 [INFO] Running configSet Infra-EmbeddedPreBuild
2024-01-01 17:25:47,138 [INFO] ConfigSets completed
2024-01-01 17:25:47,138 [INFO] -----------------------Build complete-----------------------
2024-01-01 17:25:53,734 [INFO] -----------------------Starting build-----------------------
2024-01-01 17:25:53,739 [INFO] Running configSets: Infra-EmbeddedPostBuild
2024-01-01 17:25:53,741 [INFO] Running configSet Infra-EmbeddedPostBuild
2024-01-01 17:25:53,742 [INFO] ConfigSets completed
2024-01-01 17:25:53,742 [INFO] -----------------------Build complete-----------------------

cfn-init-cmd:

2024-01-01 17:25:04,940 P1684 [INFO] ************************************************************
2024-01-01 17:25:04,940 P1684 [INFO] ConfigSet _OnInstanceBoot
2024-01-01 17:25:04,947 P1684 [INFO] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2024-01-01 17:25:04,947 P1684 [INFO] Config AWSEBBaseConfig
2024-01-01 17:25:05,583 P1684 [INFO] ============================================================
2024-01-01 17:25:05,583 P1684 [INFO] Command clearbackupfiles
2024-01-01 17:25:05,602 P1684 [INFO] Completed successfully.
2024-01-01 17:25:05,607 P1684 [INFO] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2024-01-01 17:25:05,607 P1684 [INFO] Config AWSEBCfnHupEndpointOverride
2024-01-01 17:25:05,608 P1684 [INFO] ============================================================
2024-01-01 17:25:05,608 P1684 [INFO] Command clearbackupfiles
2024-01-01 17:25:05,616 P1684 [INFO] Completed successfully.
2024-01-01 17:25:47,137 P1879 [INFO] ************************************************************
2024-01-01 17:25:47,138 P1879 [INFO] ConfigSet Infra-EmbeddedPreBuild
2024-01-01 17:25:53,741 P2041 [INFO] ************************************************************
2024-01-01 17:25:53,742 P2041 [INFO] ConfigSet Infra-EmbeddedPostBuild