Hello I am attempting to configure a django application using mod_wsgi and apache2. My current installation of mod_wsgi and apache is:
For django my version and configuration I am using a virtual environment. I previously had mod_wsgi 4.6.8 installed via pip but I was getting an error that wsgi could not accept the request.GET method I was passing to use a django-filter. While I was using the django development server this had worked fine so I assumed that there was a problem with the configuration/version of mod_wsgi inside my virtual python environment. I removed the mod_wsgi package from Python and manually installed mod_wsgi 4.6.5 into apache itself. Django configs and versions below:
With this current configuration the error I get from the /etc/httpd/logs/error_log is:
[Thu Nov 07 13:54:30.304640 2019] [wsgi:info] [pid 64753] mod_wsgi (pid=64753): Create interpreter '*****|'.
[Thu Nov 07 13:54:30.318061 2019] [wsgi:info] [pid 64753] mod_wsgi (pid=64753): Adding '/home/db_user/ciopsdb' to path.
[Thu Nov 07 13:54:30.318600 2019] [wsgi:info] [pid 64753] [client
142.136.2.11:58968] mod_wsgi (pid=64753, process='', application='****'|'): Loading Python script file '/home/db_user/ciopsdb/ciopsdb/wsgi.py'., referer: http://*****
[Thu Nov 07 13:54:30.551588 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] mod_wsgi (pid=64753): Failed to exec Python script file '/home/db_user/ciopsdb/ciopsdb/wsgi.py'., referer: http://*****
[Thu Nov 07 13:54:30.551638 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] mod_wsgi (pid=64753): Exception occurred processing WSGI script '/home/db_user/ciopsdb/ciopsdb/wsgi.py'., referer: http://*****
[Thu Nov 07 13:54:30.552417 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] Traceback (most recent call last):, referer: http://*****
[Thu Nov 07 13:54:30.552478 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] File "/home/db_user/ciopsdb/ciopsdb/wsgi.py", line 16, in <module>, referer: http://*****
[Thu Nov 07 13:54:30.552485 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] application = get_wsgi_application(), referer: http://*****
[Thu Nov 07 13:54:30.552492 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application, http://*****
[Thu Nov 07 13:54:30.552496 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] django.setup(set_prefix=False), referer: http://*****
[Thu Nov 07 13:54:30.552501 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/__init__.py", line 24, in setup, referer: http://*****
[Thu Nov 07 13:54:30.552511 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] apps.populate(settings.INSTALLED_APPS), referer: http://*****
[Thu Nov 07 13:54:30.552517 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/apps/registry.py", line 91, in populate, referer: http://*****
[Thu Nov 07 13:54:30.552521 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] app_config = AppConfig.create(entry), referer: http://*****
[Thu Nov 07 13:54:30.552526 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] File "/home/db_user/ciopsdb/venv/lib64/python3.6/site-packages/django/apps/config.py", line 136, in create, referer: http://*****
[Thu Nov 07 13:54:30.552529 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] import_module(entry), referer: http://*****
[Thu Nov 07 13:54:30.552534 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module, referer: http://*****
[Thu Nov 07 13:54:30.552538 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] return _bootstrap._gcd_import(name[level:], package, level), referer: http://*****
[Thu Nov 07 13:54:30.552543 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] File "<frozen importlib._bootstrap>", line 994, in _gcd_import, referer: http://*****
[Thu Nov 07 13:54:30.552549 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] File "<frozen importlib._bootstrap>", line 971, in _find_and_load, referer: http://*****
[Thu Nov 07 13:54:30.552554 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked, referer: http://*****
[Thu Nov 07 13:54:30.552569 2019] [wsgi:error] [pid 64753] [client
142.136.2.11:58968] ModuleNotFoundError: No module named 'mod_wsgi.server'; 'mod_wsgi' is not a package, referer: http://*****
I am new to linux/apache/mod_wsgi/ but have a little experience with Python. Any help and suggestions are appreciated as I have looked at many forum posts and documentation to try to figure this out but have exhausted my current understanding of these things. Thank you in advance!