部署使用python extdirect的Django项目时出现问题

问题描述

|| 我正在尝试使用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 \”不再起作用。 网址是在extdirect / django / templatetags / direct_providers.py文件中设置的,如果我手动将代码更改为
klass,\'/mysite/extdirect/%s/\' % name,ns).render())
它再次工作。 但是,有什么方法可以使其工作而不会干扰extdirect软件包?     

解决方法

如果没有ExtJS,此链接可能会为您提供帮助。 Apache-django-mod-wsgi。