The usage of url()
is deprecated already. Use re_path()
instead.
Given this is your URL:
http://localhost/stream/5409caac-fc9c-42b8-90af-058eff65a156?st=zD3H0cHJrbcUAHZPNbPGyg&e=1630915404
I assume the extra parameters are specifically:
?st=zD3H0cHJrbcUAHZPNbPGyg&e=1630915404
All of that string that starts from the character ?
is already part of the query string parameters. In Django, the URL pattern matching is only for the actual path, not including the query string. This is documented here:
What the URLconf searches against
The URLconf searches against the requested URL, as a normal Python
string. This does not include GET or POST parameters, or the domain
name.
For example, in a request to https://www.example.com/myapp/
, the
URLconf will look for myapp/
.
In a request to https://www.example.com/myapp/?page=3
, the URLconf
will look for myapp/
.
The URLconf doesn’t look at the request method. In other words, all
request methods – POST, GET, HEAD, etc. – will be routed to the same
function for the same URL.
So this should still work:
re_path(r'^stream/(?P<pk>[0-9a-f-]+)$', App_Views.stream, name='stream'),
If you need to access the values of the query string, access the request.GET
within the receiving view.