File: views.py

package info (click to toggle)
django-cors-headers 4.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 352 kB
  • sloc: python: 925; sh: 14; makefile: 3
file content (24 lines) | stat: -rw-r--r-- 490 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from __future__ import annotations

from http import HTTPStatus

from django.http import HttpResponse
from django.views.decorators.http import require_GET


@require_GET
def index(request):
    return HttpResponse("Index")


async def async_(request):
    return HttpResponse("Asynchronous")


def unauthorized(request):
    return HttpResponse("Unauthorized", status=HTTPStatus.UNAUTHORIZED)


def delete_enabled_attribute(request):
    del request._cors_enabled
    return HttpResponse()