Skip to content

Instantly share code, notes, and snippets.

@doubleo2
Created May 21, 2013 23:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save doubleo2/5624110 to your computer and use it in GitHub Desktop.
Save doubleo2/5624110 to your computer and use it in GitHub Desktop.
Examples of valid url template tags in Django 1.4
# Standard 1.4 urls
{% url path.to.some_view v1 v2 %}
{% url path.to.some_view arg1=v1 arg2=v2 %}
{% url app_views.client client.id %}
{% url path.to.view arg arg2 as the_url %}
{% url path.to.view as the_url %}
# Namespaced 1.4 urls
{% url myapp:view-name %}
{% url myapp:path.to.some_view v1 v2 %}
{% url myapp:path.to.some_view arg1=v1 arg2=v2 %}
{% url myapp:app_views.client client.id %}
{% url myapp:path.to.view arg arg2 as the_url %}
{% url myapp:path.to.view as the_url %}
# Standard legacy urls
{% url path.to.view arg,arg2 %}
{% url path.to.view arg, arg2 %}
# Namespaced legacy urls
{% url myapp:path.to.view arg,arg2 %}
{% url myapp:path.to.view arg, arg2 %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment