Hi I need to refresh my custom template tag –right_side.py– via Ajax. Is there a way to import the template tag in the view and return it as HttpResponse because I don’t want to give up my custom template tag (it works great in other pages) nor code a new view action which is really similar to it.
Having a link to call with Ajax or loading it in the view inside
if request.isAjax():
Are both fine for me.
I find it really useful when refreshing an area with ajax. So thought it would be good to share it:
First you import the custom template tag you coded in your view file.
And then you use it like this:
That worked for me and I got the template tag as response from server and refreshed the div with that result.