Q:

Add url parameters to a url in django view

I have a django view that lists several urls on external sites.
When I render them I would like to add a few url parameters to each.
These urls are to an external system and thus not listed in my urls.py. Furthermore, some of the links have a hash '#' so it is not as easy as appending a few parameters to the end of the string.
Based on these requirements it seems the url template tag will not be a good fit. I was wondering if there is a custom filter out that to do this.

A:

You don't need Django's url tag here. The url tag is to resolve to URLs that belong to your application.
However, there is the nice django-spurl library. It allows you to handle query parameters via template tags.
An example from the documentation to add query parameters:
{% spurl base="http://example.com/?foo=bar" add_query="bar=baz" %}

<!--
will result in: http://example.com?foo=bar&bar=baz 
-->

