2009-03-15 4 views
0

mod_python/apacheやwsgi/apacheの設定に関しては、私はこれで初めてですが、私は苦しんでいます。sshとftpを使用してWebFactionアカウントでApacheを設定するためのワークフロー。 (django/python)

私は、特にdjango開発サーバーを使用している場合、つまりpdbインターフェイスを含むすべてのサーバーアクティビティをターミナルに配置するなど、Pythonデバッガツール.. pdb.set_trace()を成功させることができました。

WebFactionなどのホストにdjangoのWebサイトを展開しようとすると、どうやってこのようになりますか?

error_logにftp以外のものがあり、失敗したことを読むと、システムと対話できますか?

うまくいけば、私はここで十分に明確です。

Btwは、私が設定しようとしているファイルです。ここ

import os 
import sys 

from os.path import abspath, dirname, join 
from site import addsitedir 

from django.core.handlers.modpython import ModPythonHandler 

import pdb 

class PinaxModPythonHandler(ModPythonHandler): 
    def __call__(self, req): 
     # mod_python fakes the environ, and thus doesn't process SetEnv. 
     # This fixes that. Django will call this again since there is no way 
     # of overriding __call__ to just process the request. 
     os.environ.update(req.subprocess_env) 
     from django.conf import settings 

     sys.path.insert(0, abspath(join(dirname(__file__), "../../"))) 

     sys.path.insert(0, os.path.join(settings.PINAX_ROOT, "apps/external_apps")) 
     sys.path.insert(0, os.path.join(settings.PINAX_ROOT, "apps/local_apps")) 

     sys.path.insert(0, join(settings.PINAX_ROOT, "apps")) 
     sys.path.insert(0, join(settings.PROJECT_ROOT, "apps")) 
     pdb.set_trace() 

     return super(PinaxModPythonHandler, self).__call__(req) 

def handler(req): 
    # mod_python hooks into this function. 
    return PinaxModPythonHandler()(req) 

とは、http経由で結果のエラーページです:

mod_wsgiを持つPDBを使用する方法
MOD_PYTHON ERROR 

ProcessId:  318 
Interpreter: 'web25.webfaction.com' 

ServerName:  'web25.webfaction.com' 
DocumentRoot: '/etc/httpd/htdocs' 

URI:   '/' 
Location:  '/' 
Directory:  None 
Filename:  '/etc/httpd/htdocs' 
PathInfo:  '/' 

Phase:   'PythonHandler' 
Handler:  'bc.deploy.modpython' 

Traceback (most recent call last): 

    File "/home/dalidada/webapps/birthconfidence/lib/python2.5/mod_python/importer.py", line 1537, in HandlerDispatch 
    default=default_handler, arg=req, silent=hlist.silent) 

    File "/home/dalidada/webapps/birthconfidence/lib/python2.5/mod_python/importer.py", line 1229, in _process_target 
    result = _execute_target(config, req, object, arg) 

    File "/home/dalidada/webapps/birthconfidence/lib/python2.5/mod_python/importer.py", line 1128, in _execute_target 
    result = object(arg) 

    File "/home/dalidada/webapps/birthconfidence/bc/deploy/modpython.py", line 33, in handler 
    return PinaxModPythonHandler()(req) 

    File "/home/dalidada/webapps/birthconfidence/bc/deploy/modpython.py", line 29, in __call__ 
    return super(PinaxModPythonHandler, self).__call__(req) 

    File "/home/dalidada/webapps/birthconfidence/lib/python2.5/django/core/handlers/modpython.py", line 191, in __call__ 
    self.load_middleware() 

    File "/home/dalidada/webapps/birthconfidence/lib/python2.5/django/core/handlers/base.py", line 40, in load_middleware 
    raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e) 

ImproperlyConfigured: Error importing middleware django_openid.consumer: "No module named django_openid.consumer" 

答えて

関連する問題