d1g1thappiness is an application that was implemented by Django rest-framework and Docker, it provides a REST API for inserting level of happiness per day, and a daily report.
Remote - Containers Remote WSL Please check the Details tab on VSCode Extentions of These two extentions, for more information.
Docker Docker - Working with containers. Remote - containers
I used this code to create docker configuratoin:Docker Configuration Use docker-compose.yml to install docker containers and the project requirements.
docker-django docker-django_webapp docker-django_db docker-django_webserver
if you have plase change the docker-compose.yml config
Use this tutorial, Remote development in Containers
- Follow the installation steps above.
- Clone https://github.com/Microsoft/vscode-remote-try-node locally.
- Start VS Code
- Run the Remote-Containers: Open Folder in Container... command and select the local folder.
docker-compose.yml will install requirement.txt which contains:
asgiref==3.3.4
Django==3.2.4
djangorestframework==3.12.4
psycopg2-binary==2.7.6.1
pytz==2021.1
sqlparse==0.4.1
typing-extensions==3.10.0.0
uWSGI==2.0.17.1
I consider level of happiness between [1-10] according to Employee Net Promoter Scores (eNPS)
For second api, which provides different result for autheticated and unathenticated user, I added date filter, to have a per day aggregation.
I can add anotehr API to get number of days and then provide a report during taht days.
run:
python manage.py test
