Развертывание проекта Django на Windows Server с помощью Apache

Я установил python 3.12, Django, Apache и протестировал все без вставки моего проекта в htdocs и его запуска. Теперь в htdocs я сохранил свой проект в двух папках core и myenv.

Внутри основных файлов проекта C:\Apache24\htdocs\core\core\wsgi.py httpd.conf.

LoadFile "C:/Program Files/Python312/python312.dll"
LoadModule wsgi_module "C:/Program Files/Python312/site-packages/mod_wsgi/server/mod_wsgi.cp312-win_amd64.pyd"
WSGIPythonHome "C:/Program Files/Python312"
WSGIScriptAlias / "C:/Apache24/htdocs/core/core/wsgi.py"
WSGIPythonPath "C:/Program Files/Python312/Lib/site-packages"
<Directory "C:/Apache24/htdocs/core/core/">
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>
Alias /static "C:/Apache24/htdocs/core/static/"
<Directory "C:/Apache24/htdocs/core/static/">
    Require all granted
</Directory>
//////
Listen 3080
ServerName example.com:80

Но когда я запускаю Apache и запускаю его, он показывает ошибку.

Внутренняя ошибка сервера:

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at admin@example.com 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.
and in logs>error:

mod_wsgi (pid=1648): Failed to exec Python script file 'C:/Apache24/htdocs/core/core/wsgi.py'.
Traceback (most recent call last):\rFile "C:/Apache24/htdocs/core/core/wsgi.py", line 16, in <module>\r line 16, in <module>\r
File "C:\\Program Files\\Python312\\lib\\site-packages\\django\\__init__.py", line 19, in setup\r
[Thu May 02 16:40:44.634611 2024] [wsgi:error] [pid 1648:tid 1228] [client ::1:50356]     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)\r
ModuleNotFoundError: No module named 'core'\r
mod_wsgi (pid=1648): Failed to exec Python script file 'C:/Apache24/htdocs/core/core/wsgi.py'., referer: http://localhost:3080/

Я хочу запустить свой проект на windows server с Apache, но из-за этих ошибок он не запускается.

Вернуться на верх