Fyyur is a musical venue and artist booking site that facilitates the discovery and bookings of shows between local performing artists and venues. This site lets you list new artists and venues, discover them, and list shows with artists as a venue owner.
-
Initialize and activate a virtualenv:
$ cd YOUR_PROJECT_DIRECTORY_PATH/ $ virtualenv --no-site-packages env $ source env/bin/activate
-
Install the dependencies:
$ pip install -r requirements.txt
-
Configure Environment variables:
$ export FLASK_ENV=development $ export APP_SETTINGS=project.config.DevelopmentConfig $ export DATABASE_URL="<YOUR LOCAL DATABASE URL>" # database used by app $ export DATABASE_TEST_URL="<YOUR LOCAL TEST DATABASE URL>" # database used by integration tests
-
Run development server:
$ python manage.py recreate_db # reset db $ python manage.py seed_db # seed db $ python manage.py run -h 0.0.0.0
-
Navigate to Home page http://localhost:5000
-
(Optional) Run tests tests:
$ python -m pytest "project/tests" -p no:warnings
- Run container:
$ cd YOUR_PROJECT_DIRECTORY_PATH/ $ docker-compose up -d --build $ docker-compose exec fyyur python manage.py recreate_db $ docker-compose exec fyyur python manage.py seed_db
- Navigate to Home page http://localhost:5001
- Run tests and quality checks:
$ docker-compose exec fyyur python -m pytest "project/tests" -p no:warnings $ docker-compose exec fyyur python -m pytest "project/tests" -p no:warnings --cov="project" # include coverage report $ docker-compose exec fyyur flake8 project # lint code $ docker-compose exec fyyur black project # format code $ docker-compose exec fyyur isort project/**/*.py # sort imports
- Connect to database via psql
docker-compose exec fyyur-db psql -U postgres
- Container cleanup
$ docker-compose stop $ docker-compose down