The problem is, it converts my data to weird signs instead of passing it as it is.
No, it does not convert anything. It here simply uses {% url 'search.html' phrase='developer' %}
as the real URL, and since a URL can not use {
, %
, etc. as characters, it uses percent encoding [wiki].
Indeed, if you use for example a tool like url-encode-decode, then you will see that it will decode this to {% url 'search.html' phrase='developer' %}
.
The reason this happens is because you apparently do not render that part of the template. This is for example the case if you use a JavaScript file that you thus serve as a static file.
You thus should make sure that the {% url … %}
part is located in the template: a file where the template engine will convert this to a URL, not in a (static) file where Django never passes this to the template engine.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…