zjm1126
zjm1126

Reputation: 66777

What does {% url %} mean in django?

<a href={% url home %}></a>

I can't find {% url %} in the Django API.

Upvotes: 1

Views: 211

Answers (1)

YOU
YOU

Reputation: 123881

url

Returns an absolute URL (i.e., a URL without the domain name) matching a given view function and optional parameters. This is a way to output links without violating the DRY principle by having to hard-code URLs in your templates:

{% url path.to.some_view arg1,arg2,name1=value1 %}

Upvotes: 3

Related Questions