title: render html page /#:id using flask
body: <p>I'm using <code>Flask</code> and want to render html pages and directly focus on a particular <code>dom element</code> using <code>/#:id</code>.</p>
  
  <p>Below is the code for default <code>/</code> rendering</p>
  
  <pre><code>@app.route('/')
  def my_form():
      return render_template("my-form.html")
  </code></pre>
  
  <p>Below is the function being called upon <code>POST</code> request.</p>
  
  <pre><code>@app.route('/', methods=['POST'])
  def my_form_post():
      #...code goes here
      return render_template("my-form.html")
  </code></pre>
  
  <p>I want to render my <code>my-form.html</code> page as <code>my-form.html/#output</code> so that it should directly focus upon the desired <code>element</code> in the dom.</p>
  
  <p>But trying <code>return render_template("my-form.html/#output")</code> tells that there's no such file and trying <code>@app.route('/#output', methods=['POST'])</code> doesn't work either.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Consider this web-app <strong>JSON2HTML</strong> - <strong><a href="http://json2html.herokuapp.com/" rel="nofollow">http://json2html.herokuapp.com/</a></strong></p>
  
  <p><em><strong>What is happening</em></strong>: Whenever a person clicks <code>send</code> button the textarea input and the styling setting is send over to my python backend flask-app as below.</p>
  
  <pre><code>@app.route('/', methods=['POST'])
      def my_form_post():
          #...code for converting json 2 html goes here
          return render_template("my-form.html",data = processed_data)
  </code></pre>
  
  <p><em><strong>What I want:</em></strong> Whenever the <code>send</code> button is clicked and the form data is <code>POSTED</code> and processed and the same page is redirected with a new parameter which contains the processed_data to be displayed. My problem is to render the same page appending the fragment identifier <code>#outputTable</code> so that after the conversion the page directly focuses on the desired output the user wants.</p>