def get_item_data(id):
    template_name = 'index.html'
obj = MyClass.objects.get(pk=id)
context = {'obj': obj}
html = render_to_string(template_name, context)
Best practice for rendering data into html with ajax