Я следую инструкциям по размещению Django приложения на Apache, и я новичок в этих типах ошибок сервера.
Я изменил файл конфигурации apache для связи с wsgi моего приложения, используя следующий код:
LoadModule wsgi_module "c:/users/adwy/appdata/local/programs/python/python35/lib/site-packages/mod_wsgi/server/mod_wsgi.cp35-win_amd64.pyd"
WSGIScriptAlias / "D:/Backup/Learning Python/Organized and important file/Learning files and sheets/Django_ Learning_ 1/weblog_app/weblog_app/wsgi.py"
WSGIPythonHome "C:/Users/Adwy/AppData/Local/Programs/Python/Python35"
WSGIPythonPath "D:/Backup/Learning Python/Organized and important file/Learning files and sheets/Django_ Learning_ 1/weblog_app/weblog_app"
Alias /static/ C:/Users/Adwy/Adwy/Django_ Learning_ 1/Lib/site-packages/django/contrib/admin\static
Alias /templates/ C:/Users/Adwy/Adwy/Django_ Learning_ 1/Lib/site-packages/django/contrib/admin/templates
<Directory C:/Users/Adwy/Adwy/Django_ Learning_ 1/Lib/site-packages/django/contrib/admin/static>
Require all granted
</Directory>
<Directory C:/Users/Adwy/Adwy/Django_ Learning_ 1/Lib/site-packages/django/contrib/admin/templates>
Require all granted
</Directory>
<Directory "D:/Backup/Learning Python/Organized and important file/Learning files and sheets/Django_ Learning_ 1/weblog_app/weblog_app">
<Files wsgi.py>
Require all granted
</Files>
</Directory>
- Теперь я перезапустил свой сервер apache и запустил Django сервер параллельно, я получаю ошибку 500,
здесь я копирую ниже журналы ошибок с сервера Apache:
[Sat Apr 04 18:41:05.681919 2020] [wsgi:warn] [pid 8608:tid 288] (70008)Partial results are valid but processing is incomplete: mod_wsgi (pid=8608): Unable to stat Python home C:/Users/Adwy/AppData/Local/Programs/Python/Python35. Python interpreter may not be able to be initialized correctly. Verify the supplied path and access permissions for whole of the path.
[Sat Apr 04 18:41:05.725921 2020] [mpm_winnt:notice] [pid 8608:tid 288] AH00354: Child: Starting 150 worker threads.
[Sat Apr 04 18:41:05.780924 2020] [wsgi:error] [pid 8608:tid 1780] [client 192.168.2.130:49438] mod_wsgi (pid=8608): Failed to exec Python script file 'D:/Backup/Learning Python/Organized and important file/Learning files and sheets/Django_ Learning_ 1/weblog_app/weblog_app/wsgi.py'.
[Sat Apr 04 18:41:05.780924 2020] [wsgi:error] [pid 8608:tid 1780] [client 192.168.2.130:49438] mod_wsgi (pid=8608): Exception occurred processing WSGI script 'D:/Backup/Learning Python/Organized and important file/Learning files and sheets/Django_ Learning_ 1/weblog_app/weblog_app/wsgi.py'.
[Sat Apr 04 18:41:05.780924 2020] [wsgi:error] [pid 8608:tid 1780] [client 192.168.2.130:49438] Traceback (most recent call last):\r
[Sat Apr 04 18:41:05.780924 2020] [wsgi:error] [pid 8608:tid 1780] [client 192.168.2.130:49438] File "D:/Backup/Learning Python/Organized and important file/Learning files and sheets/Django_ Learning_ 1/weblog_app/weblog_app/wsgi.py", line 12, in <module>\r
[Sat Apr 04 18:41:05.780924 2020] [wsgi:error] [pid 8608:tid 1780] [client 192.168.2.130:49438] from django.core.wsgi import get_wsgi_application\r
[Sat Apr 04 18:41:05.780924 2020] [wsgi:error] [pid 8608:tid 1780] [client 192.168.2.130:49438] ImportError: No module named 'django'\r
[Sat Apr 04 18:41:05.781924 2020] [wsgi:error] [pid 8608:tid 1772] [client 192.168.2.130:49439] mod_wsgi (pid=8608): Failed to exec Python script file 'D:/Backup/Learning Python/Organized and important file/Learning files and sheets/Django_ Learning_ 1/weblog_app/weblog_app/wsgi.py'.
[Sat Apr 04 18:41:05.781924 2020] [wsgi:error] [pid 8608:tid 1772] [client 192.168.2.130:49439] mod_wsgi (pid=8608): Exception occurred processing WSGI script 'D:/Backup/Learning Python/Organized and important file/Learning files and sheets/Django_ Learning_ 1/weblog_app/weblog_app/wsgi.py'.
[Sat Apr 04 18:41:05.781924 2020] [wsgi:error] [pid 8608:tid 1772] [client 192.168.2.130:49439] Traceback (most recent call last):\r
[Sat Apr 04 18:41:05.781924 2020] [wsgi:error] [pid 8608:tid 1772] [client 192.168.2.130:49439] File "D:/Backup/Learning Python/Organized and important file/Learning files and sheets/Django_ Learning_ 1/weblog_app/weblog_app/wsgi.py", line 12, in <module>\r
[Sat Apr 04 18:41:05.781924 2020] [wsgi:error] [pid 8608:tid 1772] [client 192.168.2.130:49439] from django.core.wsgi import get_wsgi_application\r
[Sat Apr 04 18:41:05.781924 2020] [wsgi:error] [pid 8608:tid 1772] [client 192.168.2.130:49439] ImportError: No module named 'django'\r
[Sat Apr 04 18:41:05.818927 2020] [wsgi:error] [pid 8608:tid 1772] [client 192.168.2.130:49441] mod_wsgi (pid=8608): Failed to exec Python script file 'D:/Backup/Learning Python/Organized and important file/Learning files and sheets/Django_ Learning_ 1/weblog_app/weblog_app/wsgi.py'., referer: http://192.168.2.130/
[Sat Apr 04 18:41:05.818927 2020] [wsgi:error] [pid 8608:tid 1772] [client 192.168.2.130:49441] mod_wsgi (pid=8608): Exception occurred processing WSGI script 'D:/Backup/Learning Python/Organized and important file/Learning files and sheets/Django_ Learning_ 1/weblog_app/weblog_app/wsgi.py'., referer: http://192.168.2.130/
[Sat Apr 04 18:41:05.818927 2020] [wsgi:error] [pid 8608:tid 1772] [client 192.168.2.130:49441] Traceback (most recent call last):\r, referer: http://192.168.2.130/
[Sat Apr 04 18:41:05.818927 2020] [wsgi:error] [pid 8608:tid 1772] [client 192.168.2.130:49441] File "D:/Backup/Learning Python/Organized and important file/Learning files and sheets/Django_ Learning_ 1/weblog_app/weblog_app/wsgi.py", line 12, in <module>\r, referer: http://192.168.2.130/
[Sat Apr 04 18:41:05.818927 2020] [wsgi:error] [pid 8608:tid 1772] [client 192.168.2.130:49441] from django.core.wsgi import get_wsgi_application\r, referer: http://192.168.2.130/
[Sat Apr 04 18:41:05.818927 2020] [wsgi:error] [pid 8608:tid 1772] [client 192.168.2.130:49441] ImportError: No module named 'django'\r, referer: http://192.168.2.130/
Основное сообщение об ошибке сервера было:
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
Надеюсь, я смогу запустить этот сервер,
спасибо ,,