私はdjango固有のものではない共有Webホストにdjangoを配備しようとしていました。ホストには古いバージョンのPythonがインストールされていますが、私はsshアクセス機能を持っているので、ホームフォルダにローカルにインストールすることで必要なモジュール(djangoを含む)でPythonインストールを拡張できました。 さて、私はdjangoプロジェクトを作成しました.PYTHONPATHとPATHグローバルなどの設定が必要です。django.fcgiスクリプトがdjangoを起動し、シェルから./django.fcgiを作成しました。 これは応答です:共有ホストのpythonメモリエラー
WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
Traceback (most recent call last):
File "/home/tentacle/lib/python2.4/site-packages/flup-1.0.3.dev_20110405-py2.4.egg/flup/server/fcgi_base.py", line 574, in run
protocolStatus, appStatus = self.server.handler(self)
File "/home/tentacle/lib/python2.4/site-packages/flup-1.0.3.dev_20110405-py2.4.egg/flup/server/fcgi_base.py", line 1159, in handler
result = self.application(environ, start_response)
File "/home/tentacle/lib/python2.4/site-packages/django/core/handlers/wsgi.py", line 272, in __call__
response = self.get_response(request)
File "/home/tentacle/lib/python2.4/site-packages/django/core/handlers/base.py", line 169, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/home/tentacle/lib/python2.4/site-packages/django/core/handlers/base.py", line 202, in handle_uncaught_exception
from django.views import debug
File "/home/tentacle/lib/python2.4/site-packages/django/views/debug.py", line 9, in <module>
from django.template import (Template, Context, TemplateDoesNotExist,
File "/home/tentacle/lib/python2.4/site-packages/django/template/__init__.py", line 53, in <module>
from django.template.base import (ALLOWED_VARIABLE_CHARS, BLOCK_TAG_END,
MemoryError
Status: 500 Internal Server Error
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>Unhandled Exception</title>
</head><body>
<h1>Unhandled Exception</h1>
<p>An unhandled exception was thrown by the application.</p>
</body></html>
だから、私はこの問題は程度(?間違った)私のユーザーのためのメモリを制限していることを承知しているが、それは私が裸ジャンゴを実行できないほど低いのですか? ちょうど悪いことには、同じプロバイダが私にテストアカウントを与えて、aはdjangoを実行するだけでなく、新しいバージョンのpythonをローカルにインストールしてniceを実行することができました。 ウェブホストのサポートに頼んだことがありましたが、回答が得られませんでした。また、彼らは再販業者であるため、私は彼らがどれくらい助けているかはよく分かりません。
この問題を解決する方法はありますか?どんな提案も大歓迎です。
ありがとうございます。
-----------------------------------アップデート--- -----------------------------------------------
#!/home/<username>/bin/python
import os, sys
sys.path.insert(0, "/home/<username>/djangoprojects")
sys.path.insert(0, "/home/<username>/djangoprojects/testproject")
os.environ['PATH']= "/home/<username>/bin:"+os.environ['PATH']
os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings'
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
これは私の設定と似ています。私は少しのエラー(通訳者のパス)があったことを認めなければならないが、 '設定'ファイルのパスは良かった。
1を右にインタプリタのパスを修正した後、最初に私が持っているStringError(djangosファイルのいずれかで、いくつかのトリプル引用されたドキュメンテーション文字列が閉じられていないていなかった - ほとんど、HM)、次回の実行MemoryErrorに比べて、再度MemoryErrorなど。しばらく(1時間)私はスクリプトをもう一度実行しました(これ以上の変更はありません)。セグメンテーションフォールト(コアダンプ)
提案がありますか?
なぜメモリが限られていると思いますか?最初の4行は欠落しているパラメータを示しています。それは言った、答えを行うhttp://stackoverflow.com/questions/800584/wsgiserver-errors-when-trying-to-run-django-appまたはhttp://stackoverflow.com/questions/2526172/settings-module-見つからない - デプロイ - Django-on-a-shared-serverはあなたのために何かをしますか? – jro
返信用のThx。欠落している4つのパラメータは、通常のブラウザ要求ではなく、シェルからスクリプトがトリガされたという事実を引き起こします。それでも、私は適切な応答を与える必要がありますが、この場合はdjangoの成功のページにする必要があります。 –