title: Python functions are called too soon in Django
body: <p>Even if I assign it to a variable, the API call triggers too soon. </p>
  
  <p>I've implemented a few ideas, as shown in the examples (not the actual code, but same principles).</p>
  
  <pre><code>""" Example #1 """
  
  fruit = 'banana'
  
  def search_engine(fruit):
      engine = {
          'apple': google.search(Time="10 hours ago"),
          'banana': yahoo.searchNow(Time="12 min ago"),
          'pear': bing.searchNow(Time="13h ago"),
          }
      print(engine[fruit])
  
  search_engine(fruit)
  
  
  
  """ Example #2 """
  
  fruit = 'banana'
  
  def search_engine(fruit):
      GS = google.search(Time="10 hours ago")
      YS = yahoo.searchNow(Time="12 min ago")
      BS = bing.searchNow(Time="13h ago")
  
      engine = {
          'apple': GS,
          'banana': YS,
          'pear': BS,
          }
      print(engine[fruit])
  </code></pre>
  
  <p>Let's assume that Time is an improper value, and will throw an exception regardless. </p>
  
  <p>in Example #1, however, "apple" is called first and throws an exception, when "banana" should be called instead.</p>
  
  <p>In Example #2, it throws an exception at "GS = google.search(Time....", instead of doing it for "YS = yahoo.searchNow..."</p>
  
  <p>I've only had this issue since trying to integrate my Python project into Django.</p>