我正在尝试使用 mod_wsgi 在 Apache 上部署一个使用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 包的情况下工作?