title: Extract from json into html using flask
body: <p>I'm writing a basic website that so far can take input from a form and add the values to a json file. I can also display the json data in a "json page". For this i do (json.dump(myGetJsonStuffFunc), indent = 4, sort_keys=True) This works wonders for the API part of the site.</p>
  
  <p>What I also want to do is retrieve that information and display it in a "regular" html page where a user can get a much better overview.</p>
  
  <p>As of right now I have function called SetValuesToHtml which i hope would set the value of a key to the variable and this is called in my route before the render_template call. But I can't figure out how to access neither the variable nor the information stored in it.</p>
  
  <p>This is my full views.py: <a href="http://pastebin.com/cneKMtZf" rel="nofollow noreferrer">http://pastebin.com/cneKMtZf</a></p>
  
  <p>The problems (i hope?) are these:</p>
  
  <pre><code>@app.route('/collection', methods = ['GET'])
  def collectionH():
      data = SetValuesToHtml()
  
  return render_template(
      'collection.html',
      title='This is our collection'
      )
  </code></pre>
  
  <p>and  the function:</p>
  
  <pre><code>def SetValuesToHtml():
      checkData()
  
  
      with open(filename+".json", "r") as infile:
          data = json.load(infile)
          infile.close()
          pass
  
      for tech in data['techs']:
          return data.endposition
      pass
  </code></pre>
  
  <p>I'm at a loss and don't really know where to look for help and thus i reach out to you. I'll gladly take a straight answer but just as happily i will take directions on what to read up on.</p>
  
  <p>Thank you</p>