1

I am trying to deploy on Apache with mod_wsgi a Django project that uses extdirect app.

extdirect app allows to use ExtJS Ext.Direct functionality with Django. Among other things, using custom template tags, it automatically adds to my templates lines like

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

In this lines, the "url" parameter is automatically set to begin with "/extdirect"

But the problem is that I mount my site at sub URL

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

so the "url" from the above script does not work anymore.

The url is set in extdirect/django/templatetags/direct_providers.py file and if I manually change the code to have

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

it works again.

But is there any way to get it working without interfering with extdirect package?

jan
  • 1,593
  • 2
  • 12
  • 15
  • add to urls.py a new url that redirect /extdirect/MyRoute to /mysite/extdirect/.... – MBarsi May 23 '11 at 12:24
  • This cannot help I think. The point is that my JavaScript makes request to `/extdirect` url and Apache tries to search it at the root, giving `File does not exist: /var/www/extdirect` error. It never reaches the mod.wsgi script... – jan May 23 '11 at 13:36

1 Answers1

0

This link will probably help you without ExtJS. Apache-django-mod-wsgi.

vkrams
  • 7,267
  • 17
  • 79
  • 129
  • I know how to deploy Django on mod_wsgi, everything works but this '/extdirect' url. The guide you posted uses `WSGIScriptAlias /` so it will not work for me - I mount my app on sub-URL `/mysite` – jan May 23 '11 at 11:16
  • But anyway, the guide you posted is very good guide to django deployment on mod_wsgi, I will bookmark it ;-) – jan May 23 '11 at 11:17