Take a look at the api view from django-rest-framework-jwt. It’s an implementation for creating auth tokens rather than cookie sessions, but your implementation will be similar. See views.py and serializers.py. You can probably use the serializers.py
unchanged, and just adjust your views to return the right parameters and possibly set the session cookie (can’t recall if that’s already performed in authentication).
Related Contents:
- Pass extra arguments to Serializer Class in Django Rest Framework
- Django REST Framework – Separate permissions per methods
- Django REST Framework serializer field required=false
- Django Rest-Framework nested serializer order
- Django REST Framework POST nested objects
- Django-Rest-Framework. Updating nested object
- How can I enable CORS on Django REST Framework
- Disable a method in a ViewSet, django-rest-framework
- django.db.migrations.exceptions.InconsistentMigrationHistory
- Django Rest Framework – Could not resolve URL for hyperlinked relationship using view name “user-detail”
- Django Rest Framework – Authentication credentials were not provided
- Include intermediary (through model) in responses in Django Rest Framework
- Retrieving a Foreign Key value with django-rest-framework serializers
- Django rest framework serializing many to many field
- Python Django Rest Framework UnorderedObjectListWarning
- Django Rest Framework — no module named rest_framework
- Django Rest Framework – How to add custom field in ModelSerializer
- What is the benefit of using a HyperlinkedModelSerializer in DRF?
- Cannot apply DjangoModelPermissions on a view that does not have `.queryset` property or overrides the `.get_queryset()` method
- Return the current user with Django Rest Framework
- Django Rest Framework: turn on pagination on a ViewSet (like ModelViewSet pagination)
- django-rest-framework 3.0 create or update in nested serializer
- OperationalError, no such column. Django
- Django Rest Framework and JSONField
- How to return custom JSON in Django REST Framework
- Django REST Framework upload image: “The submitted data was not a file”
- How can I register a single view (not a viewset) on my router?
- Proper way to consume data from RESTFUL API in django
- How can I use Django OAuth Toolkit with Python Social Auth?
- Order of Serializer Validation in Django REST Framework
- Get current user in Model Serializer
- Django Rest Framework – APIView Pagination
- User Authentication in Django Rest Framework + Angular.js web app
- Editing django-rest-framework serializer object before save
- Django Rest Framework – Get related model field in serializer
- How to add custom field in ModelSerializer?
- Django Rest Framework writable nested serializers
- how to reverse the URL of a ViewSet’s custom action in django restframework
- Why does Django Rest Framework discourage model level validation?
- Bad Django / uwsgi performance
- Django Python rest framework, No ‘Access-Control-Allow-Origin’ header is present on the requested resource in chrome, works in firefox
- How to update user password in Django Rest Framework?
- How to PATCH a single field using Django Rest Framework?
- Adding REST to Django [closed]
- Django and Middleware which uses request.user is always Anonymous
- Dynamically limiting queryset of related field
- Serialize queryset in Django rest framework
- Django REST Framework – Serializing optional fields
- How to display all model fields with ModelSerializer?
- Django viewset has not attribute ‘get_extra_actions’