Issue
In Django, I want to do this
<a href="{% url 'firstapp:create' %}?next={{ nextos|urlencode }}">
but in my views.py, when I render a page
return render(request, 'create' + parameter next=nextos)
Any ideas?
Solution
I just had to do this myself. Ended up with this solution
from django.utils.http import urlencode
from django.http import HttpResponseRedirect
Then in your view:
return HttpResponseRedirect( reverse('firstapp:create') + '?' + urlencode({'next': nextos }))
I hope that helps!
Nick
Answered By - albrnick
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.