I've been trying to deploy this app for a while until I finally did it but now when access to Heroku's link of app told me 404 not found, I don't get why cause on my Heroku logs tell that all is right.
2022-01-27T19:50:34.203255 00:00 app[web.1]: [2022-01-27 19:50:34 0000] [4] [INFO] Starting gunicorn 20.1.0
2022-01-27T19:50:34.203567 00:00 app[web.1]: [2022-01-27 19:50:34 0000] [4] [INFO] Listening at: http://0.0.0.0:7631 (4)
2022-01-27T19:50:34.203630 00:00 app[web.1]: [2022-01-27 19:50:34 0000] [4] [INFO] Using worker: sync
2022-01-27T19:50:34.207574 00:00 app[web.1]: [2022-01-27 19:50:34 0000] [9] [INFO] Booting worker with pid: 9
2022-01-27T19:50:34.242787 00:00 app[web.1]: [2022-01-27 19:50:34 0000] [10] [INFO] Booting worker with pid: 10
2022-01-27T19:50:34.741134 00:00 heroku[web.1]: State changed from starting to up
2022-01-27T19:50:38.000000 00:00 app[api]: Build succeeded
app = Flask(__name__)
@app.route('/index.html')
def index():
return render_template('index.html')
@app.route('/serviciosusa.html')
def usa_services():
return render_template('serviciosusa.html')
@app.route('/areasdeservicio.html')
def areas_services():
return render_template('areasdeservicio.html')
@app.route('/contacto.html')
def contact():
return render_template('contacto.html')
@app.route('/taxes.html')
def taxes():
return render_template('taxes.html')
@app.route('/visainversionista.html')
def inversionista():
return render_template('visainversionista.html')
@app.route('/Migracion.html')
def migracion():
return render_template('migracion.html')
@app.route('/realstare.html')
def realstare():
return render_template('realstare.html')
if __name__ == '__main__':
app.run()
CodePudding user response:
- You need to create a template folder in location where you have your app executed and place your html code there (eg. template/index.html)
- You need to type full address into the url bar because you have
@app.route('/index.html')
so you would need to enter yourip:7631/index.html - Your code is good, it's just bad execution.