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

  1. this is the registered app url like www.example.com/upload
  2. 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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top