Coder Social home page Coder Social logo

py-images-and-custom-auth-serializer's Introduction

Images and custom auth token serializer

Read the guideline before starting.

  • Download ModHeader
  • Use the following command to load prepared data from fixture to test and debug your code: python manage.py loaddata cinema_service_db_data.json.
  • After loading data from fixture you can use following superuser (or create another one by yourself):
    • Login: admin.user
    • Password: 1qazcde3

In this task you will work with images and add auth token serializer

  1. Add ImageField image to the Movie model.
    • Upload images should be only available with /upload-image/ endpoint.
    • Image format of saving must be next: f"{slugify(movie.title)}-{uuid}{ext}"
    • Image field should not be available on POST api/cinema/movies/.
    • Image url should be shown on:
      • Movie: list and detail pages
      • Movie session: on list page with movie_image key; on detail page inside movie -> image.

Movie list example:

GET http://127.0.0.1:8000/api/cinema/movies/

[
    {
        "id": 1,
        ...
        "image": "http://127.0.0.1:8000/media/uploads/movies/liar-93733032-c097-4a38-9b2b-20404e7186e6.jpeg",
        ...
    }
]

Movie session list example:

GET http://127.0.0.1:8000/api/cinema/movie_sessions/

[
    {
        "id": 1,
        ...
        "movie_image": "http://127.0.0.1:8000/media/uploads/movies/liar-93733032-c097-4a38-9b2b-20404e7186e6.jpeg",
        ...
    }
]
  1. Replace username field with email field in User model.
  2. Write custom AuthTokenSerializer, so you can obtain token with email and password

Note: Check your code using this checklist before pushing your solution.

py-images-and-custom-auth-serializer's People

Contributors

abnormaltype avatar danylott avatar dmytrosvirsa avatar masterpieceelbow avatar y-havryliv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.