title: Flask not showing the entirety of my list
body: <p>I am creating a web application that scrapes course codes, names, and credits from my schools website. When I "return render_template(...)" I only get back the last course name. But when I run the for loop by itself and tell it to print, I get everything.</p>
  
  <p>I've tried changing the output to equal something else, but that just gives me a list of lists and I want the data to appear as strings. </p>
  
  <p>This is what the code looks like by itself. I spits out the info I want:</p>
  
  <pre><code>from bs4 import BeautifulSoup 
  import csv
  import requests 
  
  source = requests.get('https://bulletins.psu.edu/undergraduate/colleges/behrend/digital-media-arts-technology-ba/#programrequirementstext') 
  
  soup = BeautifulSoup(source.text, 'lxml') 
  course_list = []
  
  for td in soup.find_all("td")[12:162]:
      courseinfo = td.text
      print(courseinfo)
  </code></pre>
  
  <p>This is what my code looks like with flask:</p>
  
  <pre><code>@app.route('/digit/')
  def digit():
      try:
          source = requests.get('https://bulletins.psu.edu/undergraduate/colleges/behrend/digital-media-arts-technology-ba/#programrequirementstext') 
  
          soup = BeautifulSoup(source.text, 'lxml') 
          course_list = []
  
          for td in soup.find_all("td")[12:162]:
              coursename = td.text
              course_list.append(coursename.split())
              print(coursename)
  
          coursename = coursename
          return render_template("digit.html", coursename = coursename)
      except Exception as e:
          return render_template("500.html", error = e)
  </code></pre>
  
  <p>And here is the html file:</p>
  
  <pre><code>{% extends "header.html" %}
  
  {% block body %}
  
      &lt;p&gt;{{coursename}}&lt;/p&gt;
  
  {% endblock %}
  </code></pre>
  
  <p>Whenever I look at my website and go to the specific page /digit/, I only get "Congress and the Presidency" to show up, which is the last possible thing in the list. I am still pretty inexperienced with flask so I don't know where to go from here.</p>