mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-13 07:21:56 +08:00
initial commit
This commit is contained in:
38
django/middleware/common.pyi
Normal file
38
django/middleware/common.pyi
Normal file
@@ -0,0 +1,38 @@
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import (
|
||||
HttpResponseBase,
|
||||
HttpResponseNotFound,
|
||||
HttpResponsePermanentRedirect,
|
||||
)
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class BrokenLinkEmailsMiddleware:
|
||||
def is_ignorable_request(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
uri: str,
|
||||
domain: str,
|
||||
referer: str
|
||||
) -> bool: ...
|
||||
def is_internal_request(self, domain: str, referer: str) -> bool: ...
|
||||
def process_response(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
response: HttpResponseNotFound
|
||||
) -> HttpResponseNotFound: ...
|
||||
|
||||
|
||||
class CommonMiddleware:
|
||||
def get_full_path_with_slash(self, request: WSGIRequest) -> str: ...
|
||||
def process_request(
|
||||
self,
|
||||
request: WSGIRequest
|
||||
) -> Optional[HttpResponsePermanentRedirect]: ...
|
||||
def process_response(
|
||||
self,
|
||||
request: HttpRequest,
|
||||
response: HttpResponseBase
|
||||
) -> HttpResponseBase: ...
|
||||
def should_redirect_with_slash(self, request: WSGIRequest) -> bool: ...
|
||||
Reference in New Issue
Block a user