Skip to content

Provide an API #35

@TeoGoddet

Description

@TeoGoddet

It would be nice to provide an API.

One exists for member management and should not be missed and may be used as example : https://github.com/ArcaniteSolutions/truffe2/blob/master/truffe2/members/views.py

Steps would be the following :
- Create an a view to create jwt api tokens
- Create an api auth backend for api that could check validity of JWT when receiving request
- Create Generic CRUD serializerers (if possible)
We may use this https://www.django-rest-framework.org/tutorial/1-serialization/#using-modelserializers (code should look like https://github.com/ArcaniteSolutions/truffe2/blob/master/truffe2/generic/forms.py)
- An then create the required views using the serializers (code should look like https://github.com/ArcaniteSolutions/truffe2/blob/master/truffe2/generic/views.py)
- Dont forget the urls
(https://github.com/ArcaniteSolutions/truffe2/blob/master/truffe2/generic/views.py)

if too complicated, still possible to create individual views

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions