Я настроил Django 2.1.15 на Centos 7 с Apache 2.4.6-93., Mod_wsgi, Virtualenv и Postgres.
А вот мой apache conf файл:
<VirtualHost *:80>
DocumentRoot /var/www/
Alias /static /var/www/myapp/static
<Directory /var/www/myapp/static>
Options FollowSymLinks
Order allow,deny
Allow from all
Require all granted
</Directory>
ErrorLog /var/www/myapp/logs/apis_error.log
CustomLog /var/www/myapp/logs/apis_access.log combined
LogLevel info
WSGIPassAuthorization On
WSGIDaemonProcess myapp python-path=/var/www/myapp:/var/www/myapp/venv/lib/python3.6/site-packages
WSGIProcessGroup myapp
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias / /var/www/myapp/myapp/wsgi.py
<Directory /var/www/myapp/myapp/myapp>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
Ошибка журнала Apache:
[wsgi:error] [pid 4829] mod_wsgi (pid=4829, process='myapp', application=''): Loading WSGI script '/var/www/myapp/myapp/wsgi.py'.
[wsgi:error] [pid 4829] mod_wsgi (pid=4829): Target WSGI script '/var/www/myapp/myapp/wsgi.py' cannot be loaded as Python module.
[wsgi:error] [pid 4829] mod_wsgi (pid=4829): Exception occurred processing WSGI script '/var/www/myapp/myapp/wsgi.py'.
[wsgi:error] [pid 4829] Traceback (most recent call last):
[wsgi:error] [pid 4829] File "/var/www/myapp/myapp/wsgi.py", line 12, in <module>
[wsgi:error] [pid 4829] from django.core.wsgi import get_wsgi_application
[wsgi:error] [pid 4829] ModuleNotFoundError: No module named 'django.core'
[wsgi:info] [pid 4829] mod_wsgi (pid=4829, process='myapp', application=''): Loading WSGI script '/var/www/myapp/myapp/wsgi.py'.
[wsgi:error] [pid 4829] mod_wsgi (pid=4829): Target WSGI script '/var/www/myapp/myapp/wsgi.py' cannot be loaded as Python module.
[wsgi:error] [pid 4829] mod_wsgi (pid=4829): Exception occurred processing WSGI script '/var/www/myapp/myapp/wsgi.py'.
[wsgi:error] [pid 4829] Traceback (most recent call last):
[wsgi:error] [pid 4829] File "/var/www/myapp/myapp/wsgi.py", line 12, in <module>
[wsgi:error] [pid 4829] from django.core.wsgi import get_wsgi_application
[wsgi:error] [pid 4829] ModuleNotFoundError: No module named 'django.core'
Есть идеи, что здесь может происходить?
Спасибо!