The challenge consists of creating two services:
- user_birthday
- letter_digit
Conditions:
- Make use of docker and docker-compose
- Make use of unit tests
a. Create an API endpoint which accepts a list of JSON objects as POST-payload.
- Store the data in a Postgres Database
- The email address should be unique
- All fields are required
Payload Example:
b. Create an API endpoint which returns a list of objects, filtered by the following parameters (birthday)
- from (example: from=%d%m)
- to (example: to=%d%m)
c. Create an API endpoint which returns the average age of all records in the database. Think about caching.
Create an API-Endpoint taking a string with letters and digits and returning a list of all possible upper & lowercase variations. Example: (a2B => [a2b, a2B, A2b, A2B])
Build and run the Docker images and map the 8050 to host.
$ docker-compose up --build -d
$ docker-cleanupNow django app is running in production mode. After postgres is up, run migrations
$ docker exec -it code_test sh -c "/venv/bin/python manage.py makemigrations --merge --noinput && /venv/bin/python manage.py migrate --noinput"Verify the deployment by navigating to the server address in your preferred browser.
localhost:8050/api/v1/redoc/
localhost:8050/api/v1/usersAsk me any questions by writing to khaligli@hotmail.com
