<input type="hidden" value="{% if post.url %}{{ post.url }}{%else
%}""{%endif%}" name="url" />
I also tried:
<input type="hidden" value="{{ post.url }}" name="url" />
In my view.py I have:
postdata = request.POST.copy()
url = str(postdata.get('url'))
The value of url is None. Is there an additional trick to this?
Thanks
Jim
1. Make sure that the hidden field is inside of the <form></form> tags.
2. You shouldn't need to copy the QueryDict to get the value:
url = request.POST.get('url', 'default') # or request.POST['url']