A
A
Andrei1penguin12020-09-13 01:05:03
Django
Andrei1penguin1, 2020-09-13 01:05:03

How to put href="" in django variable?

There is a need to insert a django variable in the action attribute of the form, but this throws an error.
In further attempts to fix something, I noticed such a feature that django variables do not work in principle in links (a tag).
I have a question, how can I implement such an entry with the page variable:
a href='{{page}}'?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-09-13
@Andrei1penguin1

Five days of suffering and three questions due to the fact that not only did you not try to read the documentation, but also the code you bring is not the one that causes an error in you.
If you pass the name of the url pattern in the page variable: If a preformed url is passed from the view:
<form action="{% url page %}">
<form action="{{ page }}">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question