아파치 2.2 HTTP 서버에서 실행하려고하는 소형 Django 웹 사이트가 있습니다. "python manage.py runserver"를 사용하여 응용 프로그램이 잘 실행되고 있습니다.아파치에 장고를 배포하는 중 오류가 발생했습니다.
장고 버전 : 1.0.2 최종
파이썬 : 2.5
OS : Windows 2000의
나는 documentation에 일부 손보는 후 설명 된 단계를 통해 wen't은에 다음과 같이 나온 내 httpd.conf.
<Location "/therap/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
PythonOption django.root /therap
PythonDebug On
PythonPath "['D:/therap/therap'] + sys.path"
</Location>
MaxRequestsPerChild 1
D : \ therap \ therap 나의 manage.py가있는 장소. 내 브라우저에서 열려고하면
, 내가 장고에 의해 사용되는 스타일에 오류가 표시
ImportError at/
No module named therap.urls
Request Method: GET
Request URL: http://****:8080/
Exception Type: ImportError
Exception Value:
No module named therap.urls
Exception Location: C:\python25\lib\site-packages\django\core\urlresolvers.py in _get_urlconf_module, line 200
Python Executable: C:\Programme\Apache Software Foundation\Apache2.2\bin\httpd.exe
Python Version: 2.5.1
Python Path: ['D:/therap/therap', 'C:\\WINNT\\system32\\python25.zip', 'C:\\Python25\\Lib', 'C:\\Python25\\DLLs', 'C:\\Python25\\Lib\\lib-tk', 'C:\\Programme\\Apache Software Foundation\\Apache2.2', 'C:\\Programme\\Apache Software Foundation\\Apache2.2\\bin', 'C:\\Python25', 'C:\\Python25\\lib\\site-packages', 'C:\\Python25\\lib\\site-packages\\pyserial-2.2', 'C:\\Python25\\lib\\site-packages\\win32', 'C:\\Python25\\lib\\site-packages\\win32\\lib', 'C:\\Python25\\lib\\site-packages\\Pythonwin', 'C:\\Python25\\lib\\site-packages\\wx-2.8-msw-unicode']
Server time: Mo, 23 Mär 2009 16:27:03 +0100
는 D의 urls.py 있습니다 (흰색 배경에 검은 택배 반대로.) \ 치료 \ 치료. 그러나 내 코드의 대부분이 D : \ therap \ therap \ main에 없습니다.
는 그때 나에게 다른 오류 준 부모 폴더<Location "/therap/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE therap.settings
PythonOption django.root /therap
PythonDebug On
PythonPath "['D:/therap'] + sys.path"
</Location>
MaxRequestsPerChild 1
사용하여 시도 :
MOD_PYTHON ERROR
ProcessId: 2424
Interpreter: '***'
ServerName: '****'
DocumentRoot: 'C:/Programme/Apache Software Foundation/Apache2.2/htdocs'
URI: '/therap/'
Location: '/therap/'
Directory: None
Filename: 'C:/Programme/Apache Software Foundation/Apache2.2/htdocs/therap'
PathInfo: '/'
Phase: 'PythonHandler'
Handler: 'django.core.handlers.modpython'
Traceback (most recent call last):
File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1229, in _process_target
result = _execute_target(config, req, object, arg)
File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1128, in _execute_target
result = object(arg)
File "C:\Python25\lib\site-packages\django\core\handlers\modpython.py", line 228, in handler
return ModPythonHandler()(req)
File "C:\Python25\lib\site-packages\django\core\handlers\modpython.py", line 201, in __call__
response = self.get_response(request)
File "C:\python25\Lib\site-packages\django\core\handlers\base.py", line 67, in get_response
response = middleware_method(request)
File "C:\python25\Lib\site-packages\django\middleware\locale.py", line 17, in process_request
translation.activate(language)
File "C:\python25\Lib\site-packages\django\utils\translation\__init__.py", line 73, in activate
return real_activate(language)
File "C:\python25\Lib\site-packages\django\utils\translation\trans_real.py", line 209, in activate
_active[currentThread()] = translation(language)
File "C:\python25\Lib\site-packages\django\utils\translation\trans_real.py", line 198, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "C:\python25\Lib\site-packages\django\utils\translation\trans_real.py", line 183, in _fetch
app = __import__(appname, {}, {}, [])
ImportError: No module named main
내가 국제화 모듈을 사용 할을하지만,이 문제에서가 발생하는 이유는 표시되지 않습니다 이 점.
"main"은보기, 모델, 양식 등을 포함하는 유일한 Django 앱의 이름입니다. 전체 경로는 D : \ therap \ therap \ main입니다.
메인 폴더의 모든 부분에 __init__.py
개의 파일을 d : \ therap에 넣었습니다.
이제는 내가 무엇을 할 수 있는지 잘 모릅니다. 어떤 아이디어?
대단히 감사합니다. 당신이 묘사 한 것처럼 보이는 것 같습니다. 그러나 내 응용 프로그램은 아직 실행되지 않습니다.그것은 내 테이블 중 하나를 찾을 수 없다 (아마 모든 sqlite3 사용). 혼자 해결할 수없는 경우 후속 질문을 게시 할 수 있습니다. – KarlsFriend