python 3.x - How to call two html file (templates) from one render in django? -


is possible render 1 request 2 different html template? i'm not talking extending or including html file of {% include .html %} or contact block

return render(request, "ticketing/all_tasks.html",                   {'tasks': tasks,                   'x':x,                   'y':y,                    'search_form': search_form}) 

i want x , y in diffrent tamplate , other 2 in diffrent.

you can use parameter in url , implement view like

def myview(request) :      type = request.get.get('type', 'html')      # processing     if type == 'html':         # return html     else if type == 'csv':         # return csv 

if access url http://yourserver/myview?type=csv render csv part of view. when url http://yourserver/myview accessed return html part of view.


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -