to know about this app and his goals please read DOCS.md
file
i'm using in this app:
- Django framework
- Django REST framework
- PostgreSQL
- NGINX
- Gunicorn
- Docker
- clone GitHub repository
- for Docker configuration you must have Docker and Docker Compose installed on your labtop
- for testing API endpoint you will need disktop application
Postman
or similar application
-
create file in path
config
with nameapp.env
and add variables to this file:SECRET
put on this variable django app secret keyDEBUGGER
put on this variable boolan flag reflect debugger mode in django app with python format (eg.False
)HOSTS
put on this variable string contain all allwed hosts separated byDB_NAME
put on this variablestring database nameDB_USER
put on this variablestring database user roleDB_PASSWORD
put on this variablestring database passwordDB_HOST
put on this variablestring docker compose database service nameDB_PORT
put on this variablestring database port5432
-
create file in path
config
with namedb.env
and add variables to this file:POSTGRES_DB
put on this variablestring database namePOSTGRES_USER
put on this variablestring database user rolePOSTGRES_PASSWORD
put on this variablestring database password
-
example on variable
DEBUGGER=False
-
to test all API endpoint you will find
Pastebin.collection.json
file on the root of repository you can import this file onPostman
to get application collection -
you can allows change collection variables
- make sure you are on root path of repository
- build docker containers by run this commans
docker-compose build
- create migrations file by run
docker-compose run web src/manage.py makemigrations
- migrate project model by run
docker-compose run web src/manage.py migrate
- create project super user
docker-compose run web src/manage.py createsuperuser
- collect static files
docker-compose run web src/manage.py collectstatic --no-input
- startup project
docker-compose up
- you can open project url localhost or localhost
- you can use
Postman
to test all API endpoint
- create
.env
file and pass all data likeconfig/app.env
from previous docker section - run
pipenv shell
to create virtual environment - run commend
pipenv install
to install dependency package - make sure you have PostgreSql database with credential provided on
.env
file - run command
python src/manage.py makemigrations
- run command
python src/manage.py migrate
- run command
python src/manage.py createsuperuser
- run command
python src/manage.py runserver
- you can open project url localhost or localhost
- you can use
Postman
to test all API endpoint
Thanks and i hope my skills on this task match with your requirements