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
Percy2y ago
Project ID: aecdad28-da47-4b87-bfdd-d01e52a8beff
Percy
Percy2y ago
⚠️ experimental feature
cordila
cordilaOP2y ago
aecdad28-da47-4b87-bfdd-d01e52a8beff
Brody
Brody2y ago
cordila
cordilaOP2y ago
gotchu thanks
cordila
cordilaOP2y ago
Just changing this fixed it lol.. why didnt what I do work tho
Brody
Brody2y 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
cordilaOP2y ago
Yeah this isnt really a large scale project, more of a college project really small scale, ill use gunicorn tho sure
Brody
Brody2y ago
much appreciated, it's always a good idea to do things the right way even for small scale projects
cordila
cordilaOP2y ago
👍
Want results from more Discord servers?
Add your server