2015-01-07 3 views
0

Я создал сайт, используя django, и пытаюсь настроить mod_wsgi на моем сервере apache.Внутренняя ошибка 500 с Django: попытка настроить mod_wsgi

Когда я иду на мой сайт, я получаю эту ошибку:

Internal Server Error 

The server encountered an internal error or misconfiguration and was unable to complete your request. 

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. 

More information about this error may be available in the server error log. 

Это файл журнала ошибка я получаю, когда я пытаюсь настройки mod_wsgi:

[Wed Jan 07 16:08:01 2015] [error] [client 108.200.246.4] mod_wsgi (pid=18513): Target WSGI script '/var/www/firstweb/firstweb/wsgi.py' cannot be loaded as Python module. 
[Wed Jan 07 16:08:01 2015] [error] [client 108.200.246.4] mod_wsgi (pid=18513): Exception occurred processing WSGI script '/var/www/firstweb/firstweb/wsgi.py'. 
[Wed Jan 07 16:08:01 2015] [error] [client 108.200.246.4] Traceback (most recent call last): 
[Wed Jan 07 16:08:01 2015] [error] [client 108.200.246.4] File "/var/www/firstweb/firstweb/wsgi.py", line 13, in <module> 
[Wed Jan 07 16:08:01 2015] [error] [client 108.200.246.4]  from django.core.wsgi import get_wsgi_application 
[Wed Jan 07 16:08:01 2015] [error] [client 108.200.246.4] ImportError: No module named django.core.wsgi 

Ниже мой HTTPD .conf файл:

WSGIScriptAlias /mahi/ /var/www/firstweb/firstweb/wsgi.py 
WSGIPythonPath /var/www/firstweb/ 

<Directory "/var/www/firstweb/firstweb"> 
<Files wsgi.py> 
    Order allow,deny 
    Allow from all 
</Files> 

</Directory> 

Пожалуйста, помогите мне. У меня нет никакого направления, куда идти.

ответ

0

кажется, что путь питона является неполным. В ubuntu это что-то вроде этого, если вы используете глобальную установку Python.

WSGIPythonPath /var/www/firstweb/:/usr/local/lib/python3.4/dist-packages 
0

Вы должны дать

WSGIPythonPath /path/to/mysite.com 

https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/modwsgi/#basic-configuration

+0

Я сделал это уже. :( – user3550366

+0

@ user3550366, тогда вам нужно указать путь к вашему проекту и сайтам-пакетам, где django живет следующим образом:/path/to/project:/path/to/site-packages/ – doniyor

+0

, где я должен это поставить? действительно новичок в этом. Мне очень жаль моих немых вопросов. – user3550366

Смежные вопросы