[Django]-Passing parameters through url to view django

3👍

Fo url like

url(r'^graph/(?P<desired_loan>\d+)/$', views.draw, name='draw'),

Change your view to:

def draw(request, *args, **kwargs):
 loanAmount = kwargs['desired_loan']
 .....

Then change in template:

<img src="{% url 'graph' loanAmount %}">
👤Anna

Leave a comment