Backend API for the event management telegram bot project. Build using Django and Postgresql.
Follow the below instructions:
To install dependencies
Run postgresql service on localhost
sudo service postgresql start
Create your .env file and fill in according to stub.env
Make migrations and migrate databases
python manage.py makemigrations lms
python manage.py migrate
Start server
python manage.py runserver
Generate a coverage report
coverage run --omit='*/venv/*' manage.py test
Read coverage report
coverage report
To get a UI coverage report for better analysis,
- Install Live Server on VS Code (Optional)
- Run the command below in your terminal, the folder htmlcov should be generated
coverage html
- Search for the folder index.html and open it on liveshare or on your file explorercoverage run --omit='/venv/' manage.py test
Install docker and docker-compose using the official docs given.
Remember to start docker service after installing .docker
sudo dockerd
Build docker image
sudo docker-compose build
In your .env file, the variable POSTGRES_HOST should be of this value POSTGRES_HOST = db.
Run the below commands to make migrations and migrate db
python3 manage.py makemigrations lms
sudo docker-compose run web python manage.py migrate
Run docker image
sudo docker-compose up
Download and install Postman GUI here.