404在成功部署后未发现Heroku问题



我试着部署这个应用程序已经有一段时间了,直到我最终做到了,但现在当访问Heroku的应用程序链接时,我不明白为什么我的Heroku日志上的原因告诉我一切都好。

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()
  1. 您需要在执行应用程序的位置创建一个模板文件夹,并将html代码放在那里(例如template/index.html(
  2. 你需要在url栏中键入完整地址,因为你有@app.route('/index.html'),所以你需要输入你的ip:7631/index.html
  3. 你的代码很好,只是执行不好

相关内容

最新更新