Django + mod_wsgi + apache2 : Модуль не найден

Я пытаюсь разместить свой django webapp на VPS, где у меня есть root доступ. Я следовал официальному учебнику django mod_wsgi apache и он почти работает... но мой виртуальный env не работает, потому что wsgi не может найти модуль django. Я провел много исследований по этой теме, но моя душа медленно умирает прямо сейчас. Помогите.

Я не понимаю, почему это не работает, я проверил свой venv в /home/env, сделав import django и он работает...

Вот мой файл apache virtualHost conf :

        ServerAdmin admin@elytrasfr.localhost
        ServerName 127.0.1.1
        ServerAlias localhost
        DocumentRoot /var/www/elytras
        ErrorLog /var/www/elytras/error.log
        CustomLog /var/www/elytras/access.log combined

        Alias /static /var/www/elytras/static

        <Directory /var/www/elytras/ecommerce>
                <Files wsgi.py>
                        Require all granted
                </Files>
        </Directory>


        WSGIScriptAlias / /var/www/elytras/ecommerce/wsgi.py process-group=elytras
        WSGIDaemonProcess elytras python-home=/home/env python-path=/var/www/elytras
        WSGIProcessGroup elytras
</VirtualHost>

Ошибка, которую я получил (в firefox):

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@elytrasfr.localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

мои журналы :

[Sun Apr 10 22:04:45.615774 2022] [wsgi:info] [pid 1088:tid 139742691768064] [remote 92.154.56.19:60814] mod_wsgi (pid=1088, process='elytras', application='127.0.1.1|'): Loading Python script file '/var/www/elytras/ecommerce/wsgi.py'.
[Sun Apr 10 22:04:45.616776 2022] [wsgi:error] [pid 1088:tid 139742691768064] [remote 92.154.56.19:60814] mod_wsgi (pid=1088): Failed to exec Python script file '/var/www/elytras/ecommerce/wsgi.py'.
[Sun Apr 10 22:04:45.616822 2022] [wsgi:error] [pid 1088:tid 139742691768064] [remote 92.154.56.19:60814] mod_wsgi (pid=1088): Exception occurred processing WSGI script '/var/www/elytras/ecommerce/wsgi.py'.
[Sun Apr 10 22:04:45.616905 2022] [wsgi:error] [pid 1088:tid 139742691768064] [remote 92.154.56.19:60814] Traceback (most recent call last):
[Sun Apr 10 22:04:45.616925 2022] [wsgi:error] [pid 1088:tid 139742691768064] [remote 92.154.56.19:60814]   File "/var/www/elytras/ecommerce/wsgi.py", line 19, in <module>
[Sun Apr 10 22:04:45.616930 2022] [wsgi:error] [pid 1088:tid 139742691768064] [remote 92.154.56.19:60814]     from django.core.wsgi import get_wsgi_application
[Sun Apr 10 22:04:45.616946 2022] [wsgi:error] [pid 1088:tid 139742691768064] [remote 92.154.56.19:60814] ModuleNotFoundError: No module named 'django'

мой wsgi.py выглядит следующим образом :

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ecommerce.settings')

application = get_wsgi_application()
Вернуться на верх