Skip to content

nahid111/flask-app

Repository files navigation

Flask App

installation

  • install pipenv
$ sudo -H pip3 install -U pipenv
  • clone the repo & cd into it
  • install dependencies
$ pipenv install
  • Copy & rename .env.example file to .env
  • Set the database credentials inside .env
  • Make DB Migrations -
$ pipenv run python manage.py db init
$ pipenv run python manage.py db migrate
$ pipenv run python manage.py db upgrade
  • run the app
$ pipenv run flask run
  • or
$ pipenv run flask run --cert=adhoc
  • or
$ pipenv run gunicorn -b 0.0.0.0:5000 --access-logfile - --reload "app:create_app()"

in case

  • generate requirements.txt
$ pipenv lock -r > requirements.txt

Run with Docker

$ docker-compose up -d
  • exec into the app container and make DB migrations
$ docker exec -it CONTAINER_ID bash
  • see app logs
$ docker logs -f CONTAINER_ID
  • clean up
$ docker-compose down -v

About

REST API - Flask, Celery, Redis, Gunicorn

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published