Skip to content

Instantly share code, notes, and snippets.

View juliaRobertav's full-sized avatar
🎯
Focusing

Julia Roberta juliaRobertav

🎯
Focusing
View GitHub Profile
@juliaRobertav
juliaRobertav / info.md
Created September 29, 2023 19:38 — forked from marteinn/info.md
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'
@Drunpy
Drunpy / django_permissions.py
Last active March 4, 2024 11:51
Exemplo de implementação de Grupos e Permissões no Django.
from django.contrib.auth.models import User
from django.contrib.auth.models import Group
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
# PERMISSÕES
# Permissões geralmente são usadas para fazer controle de acesso.
# Exemplo prático: Num sistema de gerenciamento a área de marketing pode acessar
# a área de Analytics da empresa.
# Implementação prática com as permissões do Django.
@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'