Loan-ApI is an Django Rest Framework application that helps traders request loan on your system.
Use the package manager pip to install any package in the requirements.txt file.
-
Clone the repository
https://github.com/sangkips/loan-api.git
-
Cd into the directory
cd loan-api
-
Create a virtual environment
python3 -m env venv
-
Activate virtual environment
source env/bin/activate
-
Install all projects dependencies using the
requirements.txt
file
pip install -r requirements.txt
If you prefer postgreSQL over SQLite, you need to create a local database variables using .env file and move ahead to create a local postgreSQL database on your system.
DATABASE_DB=dbname
DATABASE_USER=dbuser
DATABASE_PASSWORD=dbpassword
DATABASE_HOST=db
DATABASE_PORT=5432
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
To use Phone Number field make sure you are starting with the coutry's prefix such as (+1) for US, (+254) for Kenya)
In order to build the docker image use make
Run Docker container with the following command
-
docker-compose up
-
-d
when you want to run in detached mode
docker-compose stop
To run Django-related commands use the following
docker-compose run app /usr/local/bin/python manage.py makemigrations
app
comes fromdocker-compose.yml
file
docker-compose run app /usr/local/bin/python manage.py migrate
docker-compose run app /usr/local/bin/python manage.py createsuperuser