R
Railway16mo ago
cordila

Help running flask app

This is my first time using flask so bear with me... here is my app.py code
import mysql.connector
import logging
from flask import Flask, render_template, request

app = Flask(__name__)
app.logger.setLevel(logging.DEBUG)

@app.route('/')
def home():
return 'Hello, world!'

if __name__ == '__main__':
app.run(host='0.0.0.0', port=8080, debug=True)
import mysql.connector
import logging
from flask import Flask, render_template, request

app = Flask(__name__)
app.logger.setLevel(logging.DEBUG)

@app.route('/')
def home():
return 'Hello, world!'

if __name__ == '__main__':
app.run(host='0.0.0.0', port=8080, debug=True)
Just to test everything out, but when I visit the domain I generated it says 'Application error' Console:
* Serving Flask app 'app' (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:8080
* Running on http://xxx.xx.xx:8080
Press CTRL+C to quit
* Restarting with stat
* Debugger is active!
* Debugger PIN: xxx-xxx-xxx
* Serving Flask app 'app' (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:8080
* Running on http://xxx.xx.xx:8080
Press CTRL+C to quit
* Restarting with stat
* Debugger is active!
* Debugger PIN: xxx-xxx-xxx
10 Replies
Percy
Percy16mo ago
Project ID: aecdad28-da47-4b87-bfdd-d01e52a8beff
Percy
Percy16mo ago
⚠️ experimental feature
cordila
cordila16mo ago
aecdad28-da47-4b87-bfdd-d01e52a8beff
Brody
Brody16mo ago
cordila
cordila16mo ago
gotchu thanks
cordila
cordila16mo ago
Just changing this fixed it lol.. why didnt what I do work tho
Brody
Brody16mo ago
no, please use the template I linked as a base, it uses gunicorn, you don't ever want to use flask's built in server on railway the logs even tell you not to do it twice!
cordila
cordila16mo ago
Yeah this isnt really a large scale project, more of a college project really small scale, ill use gunicorn tho sure
Brody
Brody16mo ago
much appreciated, it's always a good idea to do things the right way even for small scale projects
cordila
cordila16mo ago
👍