Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions django-stubs/contrib/staticfiles/handlers.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any, Awaitable, Callable, Dict, Mapping, Sequence, Tuple
from urllib.parse import ParseResult

from django.core.handlers.asgi import ASGIHandler, ASGIRequest
from django.core.handlers.asgi import ASGIHandler
from django.core.handlers.base import BaseHandler
from django.core.handlers.wsgi import WSGIHandler, WSGIRequest
from django.core.handlers.wsgi import WSGIHandler
from django.http import HttpRequest
from django.http.response import HttpResponseBase
from django.http.response import FileResponse, HttpResponseBase

class StaticFilesHandlerMixin:
handles_files: bool = ...
Expand All @@ -15,7 +15,7 @@ class StaticFilesHandlerMixin:
def get_base_url(self) -> str: ...
def _should_handle(self, path: str) -> bool: ...
def file_path(self, url: str) -> str: ...
def serve(self, request: HttpRequest) -> HttpResponseBase: ...
def serve(self, request: HttpRequest) -> FileResponse: ...
def get_response(self, request: HttpRequest) -> HttpResponseBase: ...
async def get_response_async(self, request: HttpRequest) -> HttpResponseBase: ...

Expand Down
4 changes: 2 additions & 2 deletions django-stubs/contrib/staticfiles/views.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Any

from django.http.request import HttpRequest
from django.http.response import HttpResponseBase
from django.http.response import FileResponse

def serve(request: HttpRequest, path: str, insecure: bool = ..., **kwargs: Any) -> HttpResponseBase: ...
def serve(request: HttpRequest, path: str, insecure: bool = ..., **kwargs: Any) -> FileResponse: ...
4 changes: 2 additions & 2 deletions django-stubs/test/testcases.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.models.base import Model
from django.db.models.query import QuerySet, RawQuerySet
from django.forms.fields import EmailField
from django.http.response import HttpResponse, HttpResponseBase
from django.http.response import FileResponse, HttpResponseBase
from django.template.base import Template
from django.test.client import AsyncClient, Client
from django.test.html import Element
Expand Down Expand Up @@ -202,7 +202,7 @@ class FSFilesHandler(WSGIHandler):
base_url: Any = ...
def __init__(self, application: Any) -> None: ...
def file_path(self, url: Any): ...
def serve(self, request: Any): ...
def serve(self, request: Any) -> FileResponse: ...

class _StaticFilesHandler(FSFilesHandler):
def get_base_dir(self): ...
Expand Down
4 changes: 2 additions & 2 deletions django-stubs/views/static.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any, Optional

from django.http import FileResponse
from django.http.request import HttpRequest
from django.http.response import HttpResponseBase

def serve(
request: HttpRequest, path: str, document_root: Optional[str] = ..., show_indexes: bool = ...
) -> HttpResponseBase: ...
) -> FileResponse: ...

DEFAULT_DIRECTORY_INDEX_TEMPLATE: str
template_translatable: Any
Expand Down

0 comments on commit 561ee3f

Please sign in to comment.