These instructions will get you a copy of the project up and running in your local machine for development and testing purposes.
- Start your database server and create your database
- Create a working space in your local machine
- Clone this repository
git clone https://github.com/kwanj-k/ctrim-api.git
- Navigate to the project directory
- Create a virtual environment
python3 -m venv name_of_your_virtual_environment
- Create a .env file and put these key=values in it:
source name_of_your_virtual_environment/bin/activate
source venv/bin/activate
export DB_NAME="your_db_name"
export DB_USER="your_postgres_username"
export DB_PASS="your_postgres_password"
export DB_HOST="localhost or any other host name"
export DB_PORT="port_number"
- Load the environment variable
source .env
- Install dependencies to your virtual environment
pip install -r requirements.txt
- Migrate changes to the newly created database
python manage.py makemigrations
thenpython manage.py migrate
- Ensure you are in the project directory on the same level with
manage.py
and the virtual environment is activated - Run the server
python manage.py runserver
-Run your tests pytest --cov-report term-missing --cov=apps -p no:warnings