我可以通過他們的wiki上的所有內容 - 然後我迷路了。 http://wiki.dreamhost.com/Django使用乘客部署Django應用
我有一個空白的Django模板,每當我嘗試更改任何內容時,我都會收到500內部服務器錯誤。
我已經完全在本地開發了我的django應用程序,只是想在網上託管 - 認爲這很容易,但我慢慢發現它不是。
我上傳我的應用程序「視頻」到這個目錄,然後把它放入已安裝的應用程序並運行「python manage.py syncdb」,它找不到任何燈具(我發現奇怪)。
從那裏,它只是得到一個內部服務器錯誤。
這裏是我得到的錯誤:http://tweettune.com/這裏是錯誤日誌:
[Wed Aug 24 01:49:15 2011] [error] [client 66.212.30.122] Premature end of script headers:
[Wed Aug 24 01:49:15 2011] [error] [client 66.212.30.122] Premature end of script headers: internal_error.html
[Wed Aug 24 08:16:40 2011] [error] [client 99.229.160.94] Premature end of script headers:
[Wed Aug 24 08:16:41 2011] [error] [client 99.229.160.94] Premature end of script headers: internal_error.html
[Wed Aug 24 08:21:38 2011] [error] [client 99.229.160.94] Premature end of script headers:
[Wed Aug 24 08:21:38 2011] [error] [client 99.229.160.94] Premature end of script headers: internal_error.html
[Wed Aug 24 08:27:41 2011] [error] [client 99.229.160.94] Premature end of script headers:
[Wed Aug 24 08:27:41 2011] [error] [client 99.229.160.94] Premature end of script headers: internal_error.html
我一直在努力,現在6個小時,不能找出我做錯了。我想我根本不明白如何部署應用程序 - 我現在的思考過程是採用我本地託管的應用程序,並在線替換默認django模板中的所有文件。我不明白爲什麼這不應該工作,但事實並非如此。我在我的passenger_wdgi文件中使用此代碼嘗試的「Hello World應用程序」的例子,它的工作原理...
def application(environ, start_response):
start_response('200 OK', [('Content-type', 'text/plain')])
return ["Hello, world!"]
任何方向將是有益的。
編輯:這裏是我的passenger_wsgi.py文件的內容,可能會有所幫助(雖然它是由dreamhost自動生成的......所以認爲它是正確的)。
import sys, os
sys.path.append(os.getcwd())
os.environ['DJANGO_SETTINGS_MODULE'] = "sotd.settings"
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
project_path='/home/tweettune.com/sotd/'
sys.path.insert(1, project_path)
最後兩行顯示您的配置文件。 –
對不起,我不確定你的配置文件是什麼意思? passenger_wsgi.py內容?請原諒我對這個問題的無知 - 第一次嘗試部署一個項目。 – brandonmat
我認爲你的路徑錯了。導航到shell中的項目目錄,並使用'pwd'打印該目錄的全名。 – Marcin