Jimmy,
Does it NEED to be embedded into the page? I ask because something like this would be a lot easier if you executed server-side, and simply returned the output to the front-end using AJAX.
Would that serve your purpose here, or am I misunderstanding the original question?
--
Joey "JoeLinux" Espinosa
Software Developer
http://about.me/joelinux
--
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/-/heUngZyYuE8J.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
import os
from django.http import HttpResponse
...
def ajax(req):
if req.is_ajax():
stdout = os.popen("script_you_want_to_run.py")
output = stdout.read()
return HttpResponse(output)
urlpatterns = patterns('',
url(r'^ajax', 'your_project.your_app.views.ajax'),
...
)
var resultDisplay = dojo.byId("results"); // whatever element you want to display your results
dojo.xhrGet({
url: '/ajax', // this accesses the view you created earlier
load: function(data) {
resultDisplay.innerHTML = data; // 'data' should be the output that you returned from the view
}
});
jimmy--
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/-/KnKT8mJOggUJ.
Jimmy,
I don't know your specific situation, but this is probably not worth a fee. You already know Django and Python, all you need to do is extend that knowledge with some AJAX.
If you run into problems, there's always this group ;)
--
Joey "JoeLinux" Espinosa
Software Developer
http://about.me/joelinux
--
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/-/LiX0uN29AQYJ.
You could wrap it in a custom template tag:
https://docs.djangoproject.com/en/1.3/howto/custom-template-tags/
--
steve