title: Flask render_template with function return
body: <p>I recently working on Flask.
  And i have a problem with it.</p>
  
  <p>My script looks like this:</p>
  
  <pre><code>@app.route('/')
  def index():
      // execute
      return render_template('index.html', body=body, block=block)
  @app.route('/api/')
  def api():
      // execute
      return 'api'
  </code></pre>
  
  <p>function <code>api</code> and <code>index</code> do exactly same thing.</p>
  
  <p>What I think is to create a function that both page can call, and represent same thing.</p>
  
  <p>Is there a possible way to achive that?</p>