I have the following url pattern defined (simplified for clarity) that captures the asset key (an arbitrary string) from a url:
url(r'^assets/(?P<key>.+)$', views.AssetDetail.as_view())
And my view is defined like this:
def get(self, request, key):
...
This becomes interesting when I make these two requests:
- /assets/some+key
- /assets/some%2Bkey
Both requests result in the view's key
parameter containing the string "some+key". So, it looks like url decoding happens when the named group is captured and passed to the view, resulting in two different keys getting the same value. This is a problem because I need to distinguish between these two keys.
How do I get the key to be passed into my view raw and not decoded?