0

It is several years since I have used Flask, starting on a new project. I get a HTTP 404 error. The requested URL is not found??

The index and the requested URL are both in the templates folder. I don't understand why it is throwing a HTTP 404 error??

Any pointers appreciated, thanks.

Clive

I have a code snippet in routes.py.

@app.route('/service_response', methods=['GET','POST'])
def service_response():
  servicesql = "SELECT * FROM DASHBOARD_SERVICE_RESPONSE"
  data = list(conn.execute(servicesql))
      
  return render_template('service_response.html', service_response=servicesql)

In index.html I have:

<div class="form chartdisplay" >
    <div class="form-heading">BCC Report Period</div>   
        <br>
        <div class="form-group"; class="height-auto";>  
            <table>
                <thead>
                    <iframe src="service_response.html" width="90%" height="90%"></iframe>
                </thead>            
            </table>
        </div>
</div>

1 Answer 1

1

Your code points to src="service_response.html" while what you want to do is to point to /service_response which will render the 'service_response.html' jinja template.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.