L
L
lolo_to2020-12-19 17:37:43
Django
lolo_to, 2020-12-19 17:37:43

Why is a substring added when setting the url from the template?

Greetings. It has this url:

path('author_topik&<int:author_id>', author_topik.author_topikDef, name = 'ved_author_topikDef'),
, respectively, when forming a link of the type in the template, "{% url 'ved_author_topikDef' 2 %}"I can expect that a link will be formed: ... author_topik&2, but it happens that ... author_topik&amp;2. I draw attention to amp;.
Please tell me why and how to work with it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-12-19
@lolo_to

Because "&" is split for "URL parameters" and django expects path to be just "URL path".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question