Развертывание проекта django с другими приложениями с помощью Apache
Я пытаюсь развернуть веб-сайт, используя Apache и mod_wsgi, мой проект имеет больше приложений
Project/
├── Article
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── forms.py
│ ├── migrations
│ ├── models.py
│ ├── templates
│ ├── tests.py
│ ├── urls.py
│ └── views.py
├── Client
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── forms.py
│ ├── migrations
│ ├── models.py
│ ├── templates
│ ├── tests.py
│ ├── urls.py
│ └── views.py
├── ManagementSoftware
│ ├── __init__.py
│ ├── __pycache__
│ ├── admin.py
│ ├── apps.py
│ ├── forms.py
│ ├── migrations
│ ├── models.py
│ ├── static
│ ├── templates
│ ├── tests.py
│ ├── urls.py
│ └── views.py
├── Order
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── forms.py
│ ├── migrations
│ ├── models.py
│ ├── templates
│ ├── tests.py
│ ├── urls.py
│ └── views.py
├── Sites
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── forms.py
│ ├── migrations
│ ├── models.py
│ ├── templates
│ ├── tests.py
│ ├── urls.py
│ └── views.py
├── Supplier
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── forms.py
│ ├── migrations
│ ├── models.py
│ ├── templates
│ ├── tests.py
│ ├── urls.py
│ └── views.py
├── Project
│ ├── __init__.py
│ ├── __pycache__
│ ├── asgi.py
│ ├── settings.py
│ ├── settings.py.save
│ ├── urls.py
│ └── wsgi.py
├── db.sqlite3
├── manage.py
└── requiements.txt
Я настроил конфигурационный файл Apache таким образом
<VirtualHost *:80>
ServerAlias project.xyz
<Directory /var/www/vhosts/Project/Project>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess Project python-home=/var/www/vhosts/Prohect/env/
WSGIProcessGroup Project
WSGIScriptAlias / /var/www/vhosts/Project/Project/wsgi.py process-group=Project
Alias /static/ /var/www/vhosts/Project/ManagementSoftware/static/
<Directory /var/www/vhosts/Project/ManagementSoftware/static>
Require all granted
</Directory>
</VirtualHost>
При запуске проекта я получаю Error 500 Internal Server Error. Когда в приложении было только одно приложение (ManagmentSoftware), оно работало, поэтому я уверен, что проблема связана с этим изменением.
Заранее всем спасибо, я уже пытался искать пару часов, но так ничего и не нашел
Попробуйте так
<VirtualHost *:80>
# This path must be the to the root of the project
DocumentRoot /var/www/vhosts/Project
# Static folder must be in the root of the project
Alias /static/ /var/www/vhosts/Project/static
<Directory /var/www/vhosts/Project/static>
Require all granted
</Directory>
<Directory /var/www/vhosts/Project/Project>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess Project python-home=/var/www/vhosts/Project/env python-path=/var/www/vhosts/Project
WSGIProcessGroup Project
WSGIScriptAlias / /var/www/vhosts/Project/Project/wsgi.py