Skip to content

Instantly share code, notes, and snippets.

View Janchorizo's full-sized avatar
🏠
Working from home

Alejandro Rodríguez Díaz Janchorizo

🏠
Working from home
View GitHub Profile
@marteinn
marteinn / info.md
Last active January 21, 2024 06:57
Using the Fetch Api with Django Rest Framework

Using the Fetch Api with Django Rest Framework

Server

First, make sure you use the SessionAuthentication in Django. Put this in your settings.py

# Django rest framework
REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': [
 'rest_framework.authentication.SessionAuthentication'