Задать вопрос

Как развернуть Django на сервере httpd, mod_wsgi, django, virtualenv?

Добрый день!
Второй день не могу разобраться с возникшей проблемой (500 ошибка), может кто нибудь сможеть подсказать в чем проблема?
сайт: server5.diamis.ru
лог ошибки:
[Fri Apr 29 09:14:35.764746 2016] [:error] [pid 32561] [remote 178.252.111.100:112] mod_wsgi (pid=32561): Target WSGI script '/var/www/virtual/python3.4/proect/parser/SpiderSite/wsgi.py' cannot be loaded as Python module.
[Fri Apr 29 09:14:35.764773 2016] [:error] [pid 32561] [remote 178.252.111.100:112] mod_wsgi (pid=32561): Exception occurred processing WSGI script '/var/www/virtual/python3.4/proect/parser/SpiderSite/wsgi.py'.
[Fri Apr 29 09:14:35.764793 2016] [:error] [pid 32561] [remote 178.252.111.100:112] Traceback (most recent call last):
[Fri Apr 29 09:14:35.764808 2016] [:error] [pid 32561] [remote 178.252.111.100:112]   File "/var/www/virtual/python3.4/proect/parser/SpiderSite/wsgi.py", line 17, in <module>
[Fri Apr 29 09:14:35.764869 2016] [:error] [pid 32561] [remote 178.252.111.100:112]     application = get_wsgi_application()
[Fri Apr 29 09:14:35.764879 2016] [:error] [pid 32561] [remote 178.252.111.100:112]   File "/var/www/virtual/python3.4/lib/python3.4/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
[Fri Apr 29 09:14:35.764894 2016] [:error] [pid 32561] [remote 178.252.111.100:112]     django.setup()
[Fri Apr 29 09:14:35.764900 2016] [:error] [pid 32561] [remote 178.252.111.100:112]   File "/var/www/virtual/python3.4/lib/python3.4/site-packages/django/__init__.py", line 17, in setup
[Fri Apr 29 09:14:35.764910 2016] [:error] [pid 32561] [remote 178.252.111.100:112]     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Fri Apr 29 09:14:35.764916 2016] [:error] [pid 32561] [remote 178.252.111.100:112]   File "/var/www/virtual/python3.4/lib/python3.4/site-packages/django/conf/__init__.py", line 55, in __getattr__
[Fri Apr 29 09:14:35.764924 2016] [:error] [pid 32561] [remote 178.252.111.100:112]     self._setup(name)
[Fri Apr 29 09:14:35.764930 2016] [:error] [pid 32561] [remote 178.252.111.100:112]   File "/var/www/virtual/python3.4/lib/python3.4/site-packages/django/conf/__init__.py", line 43, in _setup
[Fri Apr 29 09:14:35.764938 2016] [:error] [pid 32561] [remote 178.252.111.100:112]     self._wrapped = Settings(settings_module)
[Fri Apr 29 09:14:35.764943 2016] [:error] [pid 32561] [remote 178.252.111.100:112]   File "/var/www/virtual/python3.4/lib/python3.4/site-packages/django/conf/__init__.py", line 99, in __init__
[Fri Apr 29 09:14:35.764950 2016] [:error] [pid 32561] [remote 178.252.111.100:112]     mod = importlib.import_module(self.SETTINGS_MODULE)
[Fri Apr 29 09:14:35.764956 2016] [:error] [pid 32561] [remote 178.252.111.100:112]   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
[Fri Apr 29 09:14:35.764967 2016] [:error] [pid 32561] [remote 178.252.111.100:112]     __import__(name)
[Fri Apr 29 09:14:35.764985 2016] [:error] [pid 32561] [remote 178.252.111.100:112]   File "/var/www/virtual/python3.4/proect/parser/SpiderSite/settings.py", line 138
[Fri Apr 29 09:14:35.764989 2016] [:error] [pid 32561] [remote 178.252.111.100:112] SyntaxError: Non-ASCII character '\\xd0' in file /var/www/virtual/python3.4/proect/parser/SpiderSite/settings.py on line 138, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details


конфик httpd (/etc/httpd/conf.d/wsqi.conf):
<VirtualHost *:80>
        ServerName server5.diamis.ru

        <Directory /var/www/virtual/python3.4/proect/parser/>
                Order allow,deny
                Allow from all
        </Directory>

        WSGIDaemonProcess server5.diamis.ru user=python group=python processes=5 threads=1 python-path=/var/www/virtual/python3.4/proect/parser/:/var/www/virtual/python3.4/lib/python3.4/site-packages/
        WSGIProcessGroup server5.diamis.ru

        WSGIScriptAlias / /var/www/virtual/python3.4/proect/parser/SpiderSite/wsgi.py

        #WSGIPythonPath /var/www/python/parser/

        # статичные файлы
        Alias /static/ /var/www/virtual/python3.4/proect/parser/static/
        Alias /robots.txt /var/www/virtual/python3.4/proect/parser/static/robots.txt

        <Directory /var/www/virtual/python3.4/proect/parser/SpiderSite/>
                Order deny,allow
                Allow from all
        </Directory>

        # LOG
        CustomLog /var/log/httpd/python.access.log combined
        ErrorLog /var/log/httpd/python.error.log
</VirtualHost>
  • Вопрос задан
  • 574 просмотра
Подписаться 2 Оценить Комментировать
Решения вопроса 1
fox_12
@fox_12 Куратор тега Django
Расставляю биты, управляю заряженными частицами
# -*- coding: utf-8 -*-
в SpiderSite/settings.py первой строкой пропишите
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы