This is my homepage which is produced using render_template
<form action="http://smspython.pythonanywhere/test" method="POST"> <input type="submit" value="Download a .xlsx copy to your machine" name="submit"> </form>
I get the error "Site can't be reached when I click the button". Note I have updated my website URL to replace localhost when I was testing flask.
import pyodbc
import pandas as pd
from flask import render_template,request, make_response,Flask
from io import BytesIO
app = Flask(__name__)
@app.route('/')
def sms_page():
return render_template('welcome.html') #this isn't showing logo
@app.route('/test')
def test():
return "<h1>You have met your endpoint i.e test :)</h1>" #this route is really failing me, i am confused
if __name__ == '__main__':
app.run(debug=True)
Not sure what I am really missing for /test to not work?
Second issue: my logo is not being displayed. Pretty sure this is the correct path /home/SMSPython/mysite/static/my_logo.jpg :?
<img src="/home/SMSPython/mysite/static/my_logo.jpg" alt="logo" width="155" height="70">
Thanks for your guidance and helping me on journey of learning web dev :)