initialising flask app from the command line
Hello! :)
I have been going through the flask app tutorial. When I ran from my own computer, everything worked fine. However, I have run into some problems initializing the server on repl.
Unlike the other tutorials i found on the repl website, the tutorial on the flask documentation initiated from the command line, with:
export FLASK_APP=flaskr
export FLASK_ENV=development
flask run
This (normally) works (but stopped working briefly), and runs when I open a new tab http://127.0.0.1:5000/, but it doesn't allow me and my friend to open it at the same time.
I have also tried
export FLASK_APP=flaskr
export FLASK_ENV=development
flask run --host='0.0.0.0'
This did work, but then stopped working. The error message is that this site cannot be reached
I then tried
export FLASK_APP=flaskr
export FLASK_ENV=development
flask run --host='0.0.0.0' --port=8080.
This gives the error that there is no module named 'flaskr', which is confusing, because from what I can tell, this is what the FLASK_APP=flaskr is meant to tell the flask application
sorry in advance for my own incompetence:))
Yes. You must set it as the default command repl runs.
Create a
.replit
file:replace
...
with the command you wanted to run (that flaskr run thing)Strange, try forking the repl.
@EthanHorsfallhttps://repl.it/bugs
np :) mark as correct answer?
@EthanHorsfall"First, make the export variables global by placing it in ~/.profile. Create a python3 virtualenvrinment and install respective libraries in it. after that try to run your flask app. it should work if there is no coding issue"
Do you know how to find the ~./profile on repl?