Уведомления

Группа в Telegram: @pythonsu

#1 Фев. 1, 2012 12:00:40

William
От:
Зарегистрирован: 2011-11-04
Сообщения: 9
Репутация: +  0  -
Профиль   Отправить e-mail  

Django. Internal Server Error

Здравствуйте! Решил узучить Django. Но начать не с встроенного сервера, а с настроек полной боевой конфигурации Apache (httpd-2.2.22-win32-x86-openssl-0.9.8t) + Python 2.7.2 + mod_wsgi 3.3 под Windows XP.
Все скачал, поставил.
Вот файлик vhost апачевский:

<VirtualHost 127.0.0.1:80>
ServerName spacelab-kfu.ru
DocumentRoot "D:/WEBWORK/sites/spacelab/"
Alias /media/ "D:/WEBWORK/sites/spacelab/media"
<Location "D:/WEBWORK/sites/spacelab/media">
SetHandler None
</Location>
<Directory "D:/WEBWORK/sites/spacelab/media">
Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing
</Directory>
Alias /admin_media/ "D:/WEBWORK/Python/Lib/site-packages/django/contrib/admin/media/"
<Location "/admin_media/">
SetHandler None
</Location>
<Directory "D:/WEBWORK/Python/Lib/site-packages/django/contrib/admin/media">
Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing
</Directory>

WSGIScriptAlias / "D:/WEBWORK/sites/spacelab/mod.wsgi"
<Directory "D:/WEBWORK/sites/spacelab">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
вот файл mod.wsgi:
import os, sys

sys.path.insert(0, 'D:\\WEBWORK\\Python\\Lib\\site-packages\\')
sys.path.insert(0, 'D:\\WEBWORK\\Python\\')
sys.path.append('D:\\WEBWORK\\sites\\spacelab') #Указывайте ваши пути
sys.path.append('D:\\WEBWORK\\Django\\')
#os.environ['DJANGO_SETTINGS_MODULE'] = 'D:\\WEBWORK\\sites\\spacelab\\settings.py'
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
вот список ошибок:
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.1.2 for ServerName
[Wed Feb 01 14:44:56 2012] [warn] mod_wsgi: Compiled for Python/2.7.
[Wed Feb 01 14:44:56 2012] [warn] mod_wsgi: Runtime using Python/2.7.2.
[Wed Feb 01 14:44:56 2012] [notice] Apache/2.2.22 (Win32) mod_wsgi/3.3 Python/2.7.2 configured -- resuming normal operations
[Wed Feb 01 14:44:56 2012] [notice] Server built: Jan 28 2012 11:16:39
[Wed Feb 01 14:44:56 2012] [notice] Parent: Created child process 17832
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.1.2 for ServerName
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.1.2 for ServerName
[Wed Feb 01 14:44:56 2012] [warn] mod_wsgi: Compiled for Python/2.7.
[Wed Feb 01 14:44:56 2012] [warn] mod_wsgi: Runtime using Python/2.7.2.
[Wed Feb 01 14:44:56 2012] [notice] Child 17832: Child process is running
[Wed Feb 01 14:44:56 2012] [notice] Child 17832: Acquired the start mutex.
[Wed Feb 01 14:44:56 2012] [notice] Child 17832: Starting 64 worker threads.
[Wed Feb 01 14:44:56 2012] [notice] Child 17832: Starting thread to listen on port 80.
[Wed Feb 01 14:45:01 2012] [error] [client 127.0.0.1] mod_wsgi (pid=17832, process='', application='spacelab-kfu.ru|'): Failed to parse WSGI script file 'D:/WEBWORK/sites/spacelab/mod.wsgi'.
[Wed Feb 01 14:45:01 2012] [error] [client 127.0.0.1] mod_wsgi (pid=17832): Exception occurred processing WSGI script 'D:/WEBWORK/sites/spacelab/mod.wsgi'.
[Wed Feb 01 14:45:01 2012] [error] [client 127.0.0.1] File "D:/WEBWORK/sites/spacelab/mod.wsgi", line 5
[Wed Feb 01 14:45:01 2012] [error] [client 127.0.0.1] SyntaxError: Non-ASCII character '\\xd3' in file D:/WEBWORK/sites/spacelab/mod.wsgi on line 5, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
Как исправить ошибки?



Офлайн

#2 Фев. 1, 2012 14:05:13

agalen
От:
Зарегистрирован: 2011-03-23
Сообщения: 185
Репутация: +  17  -
Профиль   Отправить e-mail  

Django. Internal Server Error

William
SyntaxError: Non-ASCII character ‘\\xd3’ in file D:/WEBWORK/sites/spacelab/mod.wsgi on line 5, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
Указывай кодировку файлов.



Офлайн

Board footer

Модераторировать

Powered by DjangoBB

Lo-Fi Version