django / apache问题,没有名为“ django”的模块

时间:2019-11-24 19:28:25

标签: python django apache mod-wsgi

我的问题是这个Image

我在我的virtualenv Pip3 freeze image

中题写了以下内容

尝试访问我的Apache网站时,出现错误500,这就是为什么我决定检查Apache日志,但我不明白如何解决它的原因 错误的apache日志是这样的:

[Sun Nov 24 19:06:06.409034 2019] [wsgi:error] [pid 30236] [client 173.44.36.79:49895] mod_wsgi (pid=30236): Target WSGI script '/var/www/html/taller_ortiz/taller_ortiz/wsgi.py' cannot be loaded as Python module.
[Sun Nov 24 19:06:06.409188 2019] [wsgi:error] [pid 30236] [client 173.44.36.79:49895] mod_wsgi (pid=30236): Exception occurred processing WSGI script '/var/www/html/taller_ortiz/taller_ortiz/wsgi.py'.
[Sun Nov 24 19:06:06.409444 2019] [wsgi:error] [pid 30236] [client 173.44.36.79:49895] Traceback (most recent call last):
[Sun Nov 24 19:06:06.409527 2019] [wsgi:error] [pid 30236] [client 173.44.36.79:49895]   File "/var/www/html/taller_ortiz/taller_ortiz/wsgi.py", line 12, in <module>
[Sun Nov 24 19:06:06.409550 2019] [wsgi:error] [pid 30236] [client 173.44.36.79:49895]     from django.core.wsgi import get_wsgi_application
[Sun Nov 24 19:06:06.409617 2019] [wsgi:error] [pid 30236] [client 173.44.36.79:49895] ImportError: No module named 'django'
[Sun Nov 24 19:06:06.813975 2019] [wsgi:error] [pid 30238] [client 173.44.36.79:49927] mod_wsgi (pid=30238): Target WSGI script '/var/www/html/taller_ortiz/taller_ortiz/wsgi.py' cannot be loaded as Python module.
[Sun Nov 24 19:06:06.814064 2019] [wsgi:error] [pid 30238] [client 173.44.36.79:49927] mod_wsgi (pid=30238): Exception occurred processing WSGI script '/var/www/html/taller_ortiz/taller_ortiz/wsgi.py'.
[Sun Nov 24 19:06:06.814249 2019] [wsgi:error] [pid 30238] [client 173.44.36.79:49927] Traceback (most recent call last):
[Sun Nov 24 19:06:06.814316 2019] [wsgi:error] [pid 30238] [client 173.44.36.79:49927]   File "/var/www/html/taller_ortiz/taller_ortiz/wsgi.py", line 12, in <module>
[Sun Nov 24 19:06:06.814330 2019] [wsgi:error] [pid 30238] [client 173.44.36.79:49927]     from django.core.wsgi import get_wsgi_application
[Sun Nov 24 19:06:06.814373 2019] [wsgi:error] [pid 30238] [client 173.44.36.79:49927] ImportError: No module named 'django'
[Sun Nov 24 19:06:07.226505 2019] [wsgi:error] [pid 30237] [client 173.44.36.79:49952] mod_wsgi (pid=30237): Target WSGI script '/var/www/html/taller_ortiz/taller_ortiz/wsgi.py' cannot be loaded as Python module.
[Sun Nov 24 19:06:07.226629 2019] [wsgi:error] [pid 30237] [client 173.44.36.79:49952] mod_wsgi (pid=30237): Exception occurred processing WSGI script '/var/www/html/taller_ortiz/taller_ortiz/wsgi.py'.
[Sun Nov 24 19:06:07.226823 2019] [wsgi:error] [pid 30237] [client 173.44.36.79:49952] Traceback (most recent call last):
[Sun Nov 24 19:06:07.226884 2019] [wsgi:error] [pid 30237] [client 173.44.36.79:49952]   File "/var/www/html/taller_ortiz/taller_ortiz/wsgi.py", line 12, in <module>
[Sun Nov 24 19:06:07.226902 2019] [wsgi:error] [pid 30237] [client 173.44.36.79:49952]     from django.core.wsgi import get_wsgi_application
[Sun Nov 24 19:06:07.226959 2019] [wsgi:error] [pid 30237] [client 173.44.36.79:49952] ImportError: No module named 'django'
[Sun Nov 24 19:13:50.131087 2019] [wsgi:error] [pid 30240] [client 68.183.199.94:47653] mod_wsgi (pid=30240): Target WSGI script '/var/www/html/taller_ortiz/taller_ortiz/wsgi.py' cannot be loaded as Python module.
[Sun Nov 24 19:13:50.131215 2019] [wsgi:error] [pid 30240] [client 68.183.199.94:47653] mod_wsgi (pid=30240): Exception occurred processing WSGI script '/var/www/html/taller_ortiz/taller_ortiz/wsgi.py'.
[Sun Nov 24 19:13:50.131406 2019] [wsgi:error] [pid 30240] [client 68.183.199.94:47653] Traceback (most recent call last):
[Sun Nov 24 19:13:50.131467 2019] [wsgi:error] [pid 30240] [client 68.183.199.94:47653]   File "/var/www/html/taller_ortiz/taller_ortiz/wsgi.py", line 12, in <module>
[Sun Nov 24 19:13:50.131484 2019] [wsgi:error] [pid 30240] [client 68.183.199.94:47653]     from django.core.wsgi import get_wsgi_application
[Sun Nov 24 19:13:50.131536 2019] [wsgi:error] [pid 30240] [client 68.183.199.94:47653] ImportError: No module named 'django'

1 个答案:

答案 0 :(得分:1)

您尚未为Django使用的Python版本安装Django,或者未加载virtualenv。

如果没有其他信息,我怀疑我们会为您提供更多帮助。