Skip to content

The purpose of this challenge is to give an overall understanding of a backend application using Django. You’ll be implementing a simplified version of a news provider API.

Notifications You must be signed in to change notification settings

epoiate/django-challenge-001

 
 

Repository files navigation

Jungle Devs - Django Challenge #001

Instructions

  1. Clone this repository to the destination folder

  2. Load Postman with News Provider.postman_collection.json

  3. Running:

    3.a For development, run docker-composer with:

    sudo docker-composer up --build -d

    3.b For production, use this one instead:

    sudo docker-composer -f docker-composer.prod.yml up --build -d

  4. If necessary, run migrations and createsuperuser:

    sudo docker-compose exec web python manage.py migrate

    sudo docker-compose exec web python manage.py createsuperuser

  5. Access the api through http://localhost/api/

Description

Challenge goal: The purpose of this challenge is to give an overall understanding of a backend application. You’ll be implementing a simplified version of a news provider API. The concepts that you’re going to apply are:

  • REST architecture;
  • Authentication and permissions;
  • Data modeling and migrations;
  • PostgreSQL database;
  • Query optimization;
  • Serialization;
  • Production builds (using Docker).

Target level: This is an all around challenge that cover both juniors and experience devs based on the depth of how the concepts were applied.

Final accomplishment: By the end of this challenge you’ll have a production ready API.

Acceptance criteria

  • Clear instructions on how to run the application in development mode
  • Clear instructions on how to run the application in a Docker container for production
  • A good API documentation or collection
  • Login API: /api/login/
  • Sign-up API: /api/sign-up/
  • Administrator restricted APIs:
    • CRUD /api/admin/authors/
    • CRUD /api/admin/articles/
  • List article endpoint /api/articles/?category=:slug with the following response:
[
  {
    "id": "39df53da-542a-3518-9c19-3568e21644fe",
    "author": {
      "id": "2d460e48-a4fa-370b-a2d0-79f2f601988c",
      "name": "Author Name",
      "picture": "https://picture.url"
    },
    "category": "Category",
    "title": "Article title",
    "summary": "This is a summary of the article"
  },
  ...
]
  • Article detail endpoint /api/articles/:id/ with different responses for anonymous and logged users:

    Anonymous

    {
      "id": "39df53da-542a-3518-9c19-3568e21644fe",
      "author": {
        "id": "2d460e48-a4fa-370b-a2d0-79f2f601988c",
        "name": "Author Name",
        "picture": "https://picture.url"
      },
      "category": "Category",
      "title": "Article title",
      "summary": "This is a summary of the article",
      "firstParagraph": "<p>This is the first paragraph of this article</p>"
    }

    Logged user

    {
      "id": "39df53da-542a-3518-9c19-3568e21644fe",
      "author": {
        "id": "2d460e48-a4fa-370b-a2d0-79f2f601988c",
        "name": "Author Name",
        "picture": "https://picture.url"
      },
      "category": "Category",
      "title": "Article title",
      "summary": "This is a summary of the article",
      "firstParagraph": "<p>This is the first paragraph of this article</p>",
      "body": "<div><p>Second paragraph</p><p>Third paragraph</p></div>"
    }

About

The purpose of this challenge is to give an overall understanding of a backend application using Django. You’ll be implementing a simplified version of a news provider API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.9%
  • Shell 1.8%
  • Dockerfile 1.3%