2011-05-23 35 views
1

我想用mod_wsgi在Apache上部署一個使用extdirect應用的Django項目。部署使用python extdirect的django項目的問題

extdirect應用程序允許在Django中使用ExtJS Ext.Direct功能。除此之外,使用自定義模板標籤,它會自動添加到我的模板線,如

<script type="text/javascript"> Ext.Direct.addProvider({"url": "/extdirect/MyRouter/", "namespace": "Remote", "type": "remoting", "id": "MyRouter", "actions": {"MyRouter": [{"name": "getTree", "len": 1}]}}); </script> 

在此行中,「URL」參數自動設置開始與「/ extdirect」

但問題是我安裝我的網站在亞URL

WSGIScriptAlias /mysite /usr/local/django/mysite/apache/django.wsgi 

所以「URL」從上面的腳本不工作了。

URL在extdirect/django/templatetags/direct_providers.py文件中設置,如果我手動修改代碼,有

klass, '/mysite/extdirect/%s/' % name, ns).render()) 

再次工作。

但有什麼辦法讓它工作而不干擾extdirect包嗎?

+0

將urls.py添加到重定向/ extdirect/MyRoute到/ mysite/extdirect /的新url。... – MBarsi 2011-05-23 12:24:35

+0

這不禁讓我想起來。問題在於我的JavaScript向/ extdirect url發出請求,並且Apache試圖在根目錄搜索它,給出'File does not exist:/ var/www/extdirect'錯誤。它從來沒有達到mod.wsgi腳本... – jan 2011-05-23 13:36:55

回答

0

此鏈接可能會幫助你沒有ExtJS。 Apache-django-mod-wsgi

+0

我知道如何在mod_wsgi上部署Django,一切正常,但是這個'/ extdirect'url。你發佈的指南使用'WSGIScriptAlias /'所以它不會爲我工作 - 我在我的應用程序上的子網址'/ mysite' – jan 2011-05-23 11:16:03

+0

但是無論如何,你發佈的指南是非常好的指導django部署mod_wsgi,我會書籤它;-) – jan 2011-05-23 11:17:36