Re: is it possible to use REST API with HTML within Django?

2013-08-15 Thread Kelvin Wong
To make calls to remote http-enabled servers, use Requests within your view. The results can be passed to the template in the standard way. http://docs.python-requests.org/en/latest/ K On Thursday, August 15, 2013 9:27:26 AM UTC-7, evh wrote: > > Hi, > > I am having trouble getting REST to wo

Re: is it possible to use REST API with HTML within Django?

2013-08-15 Thread evh
I am not too concerned about anything being returned (JSON or otherwise), it is just getting the command to the device. So for example, I have a DVR connected to my webserver, the following is the REST API call: def play(self): """ Convenience method to start playback.

Re: is it possible to use REST API with HTML within Django?

2013-08-15 Thread Brian Schott
You need to provide a lot more information before anyone can help. Sound like you have at least a view handling GET or POST returning JSON? https://docs.djangoproject.com/en/1.5/topics/class-based-views/mixins/#jsonresponsemixin-example http://django-rest-framework.org If you are talking about

is it possible to use REST API with HTML within Django?

2013-08-15 Thread evh
Hi, I am having trouble getting REST to work within Django. Has anyone succeeded in doing this? How do I embed REST API calls within the HTML that runs my webpage? I am trying to send "commands" to a device that is connected to my webpage and can do this outside of Django manually in a Powe