¿Por qué me muestra un "Application Error" al desplegar mi aplicación en heroku?
Ya llevo rato buscando solución a este problema y no dado con alguna que me funcione. Ya cambie el archivo Procfile, edite los puertos en la aplicación flask que es el framework que uso para las rutas e incluso hice un proyecto mucho más simple y tampoco funciona.
Este es el log de heroku en la terminal, después de estas lineas se repiten los mismos mensajes una y otra vez.
2022-08-19T19:57:52.450206+00:00 app[web.1]: Address already in use
2022-08-19T19:57:52.450211+00:00 app[web.1]: Port 5000 is in use by another program. Either identify and stop that program, or start the server with a different port.
2022-08-19T19:57:52.450406+00:00 app[web.1]: [2022-08-19 19:57:52 +0000] [5019] [INFO] Worker exiting (pid: 5019)
2022-08-19T19:57:52.511167+00:00 app[web.1]: [2022-08-19 19:57:52 +0000] [5020] [INFO] Booting worker with pid: 5020
2022-08-19T19:57:52.659210+00:00 app[web.1]: * Serving Flask app 'app'
2022-08-19T19:57:52.659214+00:00 app[web.1]: * Debug mode: off
2022-08-19T19:57:52.661271+00:00 app[web.1]: Address already in use
2022-08-19T19:57:52.661272+00:00 app[web.1]: Port 5000 is in use by another program. Either identify and stop that program, or start the server with a different port.
Aquí el código de prueba en flask que utilizo
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return "<h1>Hola mundo</h1>"
app.run(port = 5000)
Si tienen alguna solución se los agradecería mucho.
port = int(os.environ.get('PORT', 5000))