sangue/django/sangue_app/views.py

20 lines
806 B
Python

from copy import deepcopy
from django.shortcuts import render, redirect
from django.http import JsonResponse, HttpResponse
from django.utils.http import url_has_allowed_host_and_scheme
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import authenticate, login, logout
from rest_framework import viewsets
from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from rest_framework.permissions import DjangoModelPermissions, IsAuthenticated
from django_auto_prefetching import AutoPrefetchViewSetMixin
from . import models
from . import serializers
# def index(request):
# return HttpResponse("Hello, %s!" % (request.user.username if request.user.is_authenticated else 'World'))
# --------------- FINE PREFISSO TEMPLATE ---------------