(Windows, with virtualenv, run locally, in development mode)
py -m venv env
get virtual env- On Linux, if you're required to download virtualenv, use
pip3 install virtualenv
- On Linux, if you're required to download virtualenv, use
.\env\Scripts\activate
activate virtual envpip install -r requirements.txt
install all required packages (flask etc.)- On Linux, if pip isn't present in the virtualenv, try
env/bin/python -m pip install -r requirements.txt
- On Linux, if pip isn't present in the virtualenv, try
set FLASK_APP=app.py
activate .py file to be the applicationset FLASK_ENV=development
activate development modepython -m flask run --host=0.0.0.0
run the application- Visit "http://localhost:5000/" to see the application
deactivate
close the virtual environment after you close the app
.\env\Scripts\activate
activate virtual envset FLASK_APP=app.py
activate .py file to be the applicationset FLASK_ENV=development
activate development modepython -m flask run --host=0.0.0.0
run the application- On Linux, if the virtualenv cannot be found when trying to run the app, use
venv/bin/python app.py
- If you've activated the virtualenv, you shouldn't have to use the directory to the virtualenv in order to do everything. These commands are here incase you cannot get it activated.
- On Linux, if the virtualenv cannot be found when trying to run the app, use
- Visit "http://localhost:5000/" to see the application
deactivate
close the virtual environment after you close the app
/* (All the commands (command
) above are executed via the command line) */
Flask automatically caches your static files the first time they're loaded via Flask and because of this, you may have noticed that any changes your making aren't being applied when you refresh the page. For the changes to me made, you need to clear the cache and refresh the page, which you can do by pressing ctrl+F5
.