url
tag doesn't handle external urls, it was designed to make a url from the view function and optional parameters. Just don't use url
tag in this case.
u'https' is not a registered namespace
-
08-07-2023 - |
Question
I am trying to set the form action url dynamically from the server,
this is what the view action returns,
return render_to_response('filebrowser/form.html', {
'posturl': posturl,
}, context_instance=Context(request))
and the posturl can have two values
- this is the registered app url like www.example.com/upload
this is the other url which is youtube upload url which is like
https://uploads.gdata.youtube.com/.........
while rendering the form itself if the posturl value is 1 its working fine, but if the value is second option then i am getting the error:
Exception Type: NoReverseMatch
Exception Value: u'https' is not a registered namespace
but in case if i am rendering entire html with action from server its working fine,
like
form = "<form action=posturl><form>"
return HttpResponse(form)
any help would be appreciated,
How i used posturl in template. i am using uploadify for upload.
jQuery(function($) {
$('#id_file').uploadify({
.....
'script' : '{% url posturl%}',
....
});
please avoid any syntax errors
thanks
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow