I figured it out. The idea is NOT to use CGI. It is not needed. Simply use a Django WSGI URL to access the python module (in a view) and everything it works fine. It as blindingly obvious once I figured it out.
Here is what I did to get it to work:
- Added a new URL called '/status/sync' in urls.py: url(r'^sync/status/$','status'),
- Added status to my views.py:
from django.http import HttpResponse
import datetime
def sync_status(request):
now = datetime.datetime.now()
html = 'now = %s' % (now)
return HttpResponse(html) - Changed my index.html javascript as follows:
$('#status').load('/employees/sync/status');
Sorry to have bothered you.
Regards,
Joe
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/nSUGnywpdngJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment