Ich bin neu hier, aber wenn es um die Konfiguration von mod_python/apache oder wsgi/apache geht mir leid.Workflow zum Konfigurieren von Apache auf einem Webfaction-Konto über SSH und FTP. (django/python)
Ich war in der Lage, das Python-Debugger-Tool .. pdb.set_trace()
zum Erfolg, vor allem bei der Verwendung des Django-Entwicklungs-Server, d. H. Es setzt alle Terminal-Aktivität, einschließlich der pdb-Schnittstelle.
Also, wie macht man so etwas, wenn man versucht, eine Django-Website auf einem Host wie webfaction bereitzustellen?
Anders als ftp in die error_log und lesen Sie darüber nach Fehler, in der Lage sein, mit dem System zu interagieren, wie es passiert?
Hoffentlich bin ich hier klar genug.
Btw, folgende ist die Datei, die ich versuche zu konfigurieren.
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)
und hier ist die resultierende Fehlerseite über http:
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"