-
Notifications
You must be signed in to change notification settings - Fork 98
Starting Flask
Running the development server for Docker is different. Look at the Second section for instructions.
To run the server, make sure you are in the root directory. Then, startup the virtual environment and run the server:
$ pipenv shell # startup virtual environment
(flask-boilerplate-_rcP-Rlt) bash-3.2$ python manage.py runserver
If you are using pipenv, you may also run commands without being inside your virtual environment:
$ pipenv run python manage.py runserver # pipenv run [command]
The API should be at http://127.0.0.1:5000/ for you to experience its beauty. If that link doesn't work, try http://localhost:5000 instead.
If you setup this boilerplate using Docker, you must run the Docker Containers itself, not the development server. To start your Postgres and your flask api:
$ docker-compose start
If you haven't built the images, then:
$ docker-compose up -d
-d
runs it in the background.
To stop them:
$ docker-compose stop
To view your logs for the api:
$ docker-compose logs app
If you need to rebuild your containers, delete the previous containers and rebuild
$ docker-compose rm -f
$ docker-compose up -d