/working-hours

Working-hours project with rest framework and django

Primary LanguagePython

Creation of a restframework API with Django

Follow these commands for building the container:

docker-compose build
docker-compose up

It's possible to drop all containers with this command:

docker-compose down

With this command you can access to one shell associated to the web container:

docker-compose up web /bin/bash

When the web container is running it's necessary to create the migrations in the database, so execute this:

python manage.py migrate

With this command you can create a superuser account:

python manage.py createsuperuser

The admin page will be available in the following URL: http://localhost:8081/admin

The django project and several apps were created with these commands in local:

django-admin startproject django_project .
django-admin startapp api

Working hours

Endpoints:

  • Registered days:

    http://localhost:8081/api/v0/working-hours/
    
  • Summary of the week:

    http://localhost:8081/api/v0/working-hours/week/23/year/2019/user/username/