Rajeev
Rajeev

Reputation: 46919

Django send filepath to views.py

In django urls how to send a file path and access the same from the view.I have tried the following below but i get an error,whats wrong with this code.

javascript

  window.location="/tagging/send_file"+data.filename;
  //which is nothing but /tagging/send_file/media/tmp/sssss.txt

urls.py =url(r'^send_file/(?P<path>.*)$', 'send_file'),

views.py:

def send_file(request):
 logging.debug("========================== Got file request")

Upvotes: 0

Views: 941

Answers (1)

Rohan
Rohan

Reputation: 53336

Try adding parameter to your view as

def send_file(request, path):

Upvotes: 1

Related Questions