title: How to use flask variable in href tag?
body: <p>Below is the code to upload a file using flask and python and then I wish to use the <code>filename</code> variable in href tag!</p>
  
  <p>I am trying with <code>{{filename}}</code> but I can't access it.</p>
  
  <pre><code>    def index():
      if request.method == 'POST':
          file = request.files['file']
          if file and allowed_file(file.filename):
              filename = secure_filename(file.filename)
              path = "./audiofile.txt"
              filepath = open(path, "w")
              filepath.write(filename)           
              file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
              filepath.close()
              os.system('python ../speech-to-text/slow.py')
              os.system('python ../sentiment-analysis/test.py')
              return redirect(url_for('index'))
      return """
      &lt;!doctype html&gt;
      &lt;head&gt;&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
    &lt;title&gt;Online audio/video transcription!&lt;/title&gt;
  
    &lt;link rel="stylesheet" type="text/css" href="static/bootstrap.min.css"/&gt;
    &lt;/head&gt;
      &lt;title&gt;Upload new File&lt;/title&gt;&lt;br&gt;
      &lt;center&gt;
      &lt;h1&gt;Upload new File&lt;/h1&gt;&lt;br&gt;
      &lt;form action="" method=post enctype=multipart/form-data&gt;
        &lt;p&gt;&lt;input type=file name=file&gt;&lt;br/&gt;&lt;br/&gt;
           &lt;input class=btn-success type=submit value=Upload&gt;
      &lt;/form&gt;
      &lt;hr&gt;
      &lt;h4&gt;Download transcript file (with sentiment analysis) &lt;a href="tmp/{{filename}}.txt"&gt;here&lt;/a&gt;!&lt;/h4&gt;
      &lt;/center&gt;
  
      &lt;p&gt;%s&lt;/p&gt;
      """ % "&lt;br&gt;"
  </code></pre>