You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The last time that I ran flask run and had details cut off like this it was because eventlet was not installed and everything started failing silently without any warning. Is this also a known issue? The thing is is that I'm able to curl http://127.0.0.1:5000 but even with a prod.py script I am seemingly unable to change ports or hosts to use the production server, and I am seriously questioning the missing console loggine.
Both of the above outputs are from using an app factory in garden/__init__.py but I will also paste a prod.py script that I tried to use to fix the problem but did not appear to make a difference.
garden/init.py
import os
from flask import Flask
from flask_socketio import SocketIO
socketio = SocketIO()
def create_app(test_config=None):
# create and configure the app
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY='dev',
DATABASE=os.path.join(app.instance_path, 'garden.sqlite'),
)
if test_config is None:
# load the instance config, if it exists, when not testing
app.config.from_pyfile('config.py', silent=True)
else:
# load the test config if passed in
app.config.from_mapping(test_config)
# ensure the instance folder exists
try:
os.makedirs(app.instance_path)
except OSError:
pass
from . import db
db.init_app(app)
from . import auth
app.register_blueprint(auth.bp)
from . import manager
manager.init_app(app)
socketio.init_app(app)
return app
prod.py
from garden import create_app, socketio
if __name__ == "__main__":
app = create_app()
socketio.run(app, host='0.0.0.0', port=8080)
Even removing gunicorn did not seem to change anything. It was left over from my testing of various production environments.
@miguelgrinberg I saw your PR in the Flask repository in reference to my last Flask issue which seems to be related. Is there an alternate way for me to launch the application and work around the flask run issues without having to downgrade my app to Flask==0.12.4?
Also perhaps useful, this is my directory structure
Starting with Flask-SocketIO 3.2.0, the flask run command is only used to run the Flask development webserver. To use a different webserver use one of the other methods of starting the server, either socketio.run(app) or a recommended method for the webserver of choice.
development
production
The last time that I ran
flask run
and had details cut off like this it was becauseeventlet
was not installed and everything started failing silently without any warning. Is this also a known issue? The thing is is that I'm able tocurl http://127.0.0.1:5000
but even with aprod.py
script I am seemingly unable to change ports or hosts to use the production server, and I am seriously questioning the missing console loggine.Both of the above outputs are from using an app factory in
garden/__init__.py
but I will also paste aprod.py
script that I tried to use to fix the problem but did not appear to make a difference.garden/init.py
prod.py
pip freeze
Even removing gunicorn did not seem to change anything. It was left over from my testing of various production environments.
@miguelgrinberg I saw your PR in the Flask repository in reference to my last Flask issue which seems to be related. Is there an alternate way for me to launch the application and work around the flask run issues without having to downgrade my app to Flask==0.12.4?
Also perhaps useful, this is my directory structure
When I tested the
prod.py
script I would setFLASK_APP=prod.py
The text was updated successfully, but these errors were encountered: