This repo contains backend REST API for Smart Waste Segregator and Route Planner.
-
Create new user for AWS Rekognition service from IAM dashboard
-
Create new policy with below JSON rules
{ "Version": "2012-10-17", "Statement": [ { "Sid": "VisualRecognitionAccess", "Effect": "Allow", "Action": [ "rekognition:DetectLabels" ], "Resource": "*" } ] }
-
Create programmatic access keys for the user
-
Update access keys in
.env
file
-
clone/download this repo
git clone https://github.com/SmartWasteSegregatorAndRoutePlanner/Backend-APIs.git
-
Change directory
cd Backend-APIs
-
Install requirements
-
Install Poetry
-
Install virtualenv
python -m pip install virtualenv
-
Create Virtual env
python -m virtualenv env
-
-
Install dependencies
poetry install
-
Create Migrations
python manage.py makemigrations
-
Migrate DB
python manage.py migrate
-
Collect Static Files
python manage.py collectstatic
-
Generate DJANGO_SECRET_KEY using below command:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key());"
-
Update
.env
fileDJANGO_SECRET_KEY=l#kcn**xhq(mux@h4w_+nk1n($y2krhgoo9mab5ur^ebgh8y(6 DEBUG=False ALLOWED_HOSTS=* AWS_ACCESS_KEY_ID=your-aws-access-key-id AWS_SECRET_ACCESS_KEY=your-aws-secret-access-key AWS_DEFAULT_REGION=your-aws-region
-
Start Web Application
python manage.py runserver 0.0.0.0:8000
Note: Allow Port
8000
through firewall.