S
S
sortfact3332020-11-09 17:35:07
Django
sortfact333, 2020-11-09 17:35:07

How to get url inside views.py?

I need analog But inside views.py
{% url 'article:add' id %}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Kuts, 2020-11-09
@sortfact333

Something like this:

from django.urls import reverse

url = reverse('article:add', kwargs={'id': id})

M
Maxim, 2020-11-09
@Tomio

reverse() function

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question