Tip
|
Always read the doc. And remember to update the doc as soon as there is need for it to allow others have a smooth development experience. |
Clone the repo
git clone https://github.com/capitalsagetechnology/py-api-template.git
cd py-api-template
Update the .env from the .env.sample you can copy it
Ensure that the latest version of docker desktop is installed on your local machine. This will also install docker compose alongside automatically. Follow this link to install docker docker installation.
The run the following command from the root of the application
docker compose up --build
Access the API doc on API Doc
In order to run tests you need to do the following
docker compose run api pytest
Alternatively, you can following the following approach.
docker compose build docker compose run test
Note also that when you run
the test service also runs once. You can monitor from the logsdocker compose up --build
Whenever you make changes to models, you need to generate migrations locally before pushing your code to the repo. In order to generate migrations, kindly run the following command in another terminal window while your main app is also running
docker compose exec api python manage.py makemigrations
docker compose exec api python manage.py migrate
Visit the deployed links below
The other codebases that are related to this one are
Name | Role | |
---|---|---|
Daniel Ale |
SA |
Happy Coding