mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-09-08 15:53:23 +08:00
initial commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
from django.core.checks.messages import Error
|
||||
from typing import List
|
||||
|
||||
|
||||
def check_default_cache_is_configured(app_configs: None, **kwargs) -> List[Error]: ...
|
||||
@@ -0,0 +1,31 @@
|
||||
from typing import (
|
||||
Any,
|
||||
Optional,
|
||||
)
|
||||
|
||||
|
||||
class CheckMessage:
|
||||
def __eq__(self, other: CheckMessage) -> bool: ...
|
||||
def __init__(
|
||||
self,
|
||||
level: int,
|
||||
msg: str,
|
||||
hint: Optional[str] = ...,
|
||||
obj: Any = ...,
|
||||
id: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
def is_serious(self, level: int = ...) -> bool: ...
|
||||
def is_silenced(self) -> bool: ...
|
||||
|
||||
|
||||
class Critical:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
|
||||
|
||||
class Error:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
|
||||
|
||||
class Warning:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
@@ -0,0 +1,24 @@
|
||||
from django.apps.registry import Apps
|
||||
from django.core.checks.messages import (
|
||||
Error,
|
||||
Warning,
|
||||
)
|
||||
from typing import (
|
||||
Any,
|
||||
List,
|
||||
Optional,
|
||||
Set,
|
||||
Tuple,
|
||||
)
|
||||
|
||||
|
||||
def _check_lazy_references(
|
||||
apps: Apps,
|
||||
ignore: Optional[Set[Tuple[str, str]]] = ...
|
||||
) -> List[Error]: ...
|
||||
|
||||
|
||||
def check_all_models(app_configs: None = ..., **kwargs) -> List[Warning]: ...
|
||||
|
||||
|
||||
def check_lazy_references(app_configs: None = ..., **kwargs) -> List[Any]: ...
|
||||
@@ -0,0 +1,20 @@
|
||||
from django.core.checks.messages import Warning
|
||||
from typing import (
|
||||
Callable,
|
||||
List,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
class CheckRegistry:
|
||||
def __init__(self) -> None: ...
|
||||
def get_checks(self, include_deployment_checks: bool = ...) -> List[Callable]: ...
|
||||
def register(self, check: Union[str, Callable] = ..., *tags, **kwargs) -> Callable: ...
|
||||
def run_checks(
|
||||
self,
|
||||
app_configs: None = ...,
|
||||
tags: Optional[List[str]] = ...,
|
||||
include_deployment_checks: bool = ...
|
||||
) -> Union[List[str], List[Warning], List[int]]: ...
|
||||
def tag_exists(self, tag: str, include_deployment_checks: bool = ...) -> bool: ...
|
||||
@@ -0,0 +1,35 @@
|
||||
from django.core.checks.messages import Warning
|
||||
from typing import (
|
||||
Any,
|
||||
List,
|
||||
)
|
||||
|
||||
|
||||
def _security_middleware() -> bool: ...
|
||||
|
||||
|
||||
def _xframe_middleware() -> bool: ...
|
||||
|
||||
|
||||
def check_content_type_nosniff(app_configs: None, **kwargs) -> List[Warning]: ...
|
||||
|
||||
|
||||
def check_debug(app_configs: None, **kwargs) -> List[Any]: ...
|
||||
|
||||
|
||||
def check_secret_key(app_configs: None, **kwargs) -> List[Warning]: ...
|
||||
|
||||
|
||||
def check_security_middleware(app_configs: None, **kwargs) -> List[Warning]: ...
|
||||
|
||||
|
||||
def check_ssl_redirect(app_configs: None, **kwargs) -> List[Warning]: ...
|
||||
|
||||
|
||||
def check_sts(app_configs: None, **kwargs) -> List[Warning]: ...
|
||||
|
||||
|
||||
def check_xframe_deny(app_configs: None, **kwargs) -> List[Warning]: ...
|
||||
|
||||
|
||||
def check_xss_filter(app_configs: None, **kwargs) -> List[Warning]: ...
|
||||
@@ -0,0 +1,8 @@
|
||||
from django.core.checks.messages import Warning
|
||||
from typing import List
|
||||
|
||||
|
||||
def _csrf_middleware() -> bool: ...
|
||||
|
||||
|
||||
def check_csrf_middleware(app_configs: None, **kwargs) -> List[Warning]: ...
|
||||
@@ -0,0 +1,13 @@
|
||||
from typing import (
|
||||
Any,
|
||||
List,
|
||||
)
|
||||
|
||||
|
||||
def _session_app() -> bool: ...
|
||||
|
||||
|
||||
def _session_middleware() -> bool: ...
|
||||
|
||||
|
||||
def check_session_cookie_secure(app_configs: None, **kwargs) -> List[Any]: ...
|
||||
@@ -0,0 +1,11 @@
|
||||
from django.core.checks.messages import Error
|
||||
from typing import (
|
||||
Any,
|
||||
List,
|
||||
)
|
||||
|
||||
|
||||
def check_setting_app_dirs_loaders(app_configs: None, **kwargs) -> List[Any]: ...
|
||||
|
||||
|
||||
def check_string_if_invalid_is_string(app_configs: None, **kwargs) -> List[Error]: ...
|
||||
@@ -0,0 +1,38 @@
|
||||
from django.core.checks.messages import (
|
||||
Error,
|
||||
Warning,
|
||||
)
|
||||
from django.urls.resolvers import (
|
||||
URLPattern,
|
||||
URLResolver,
|
||||
)
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
List,
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
def E006(name: str) -> Error: ...
|
||||
|
||||
|
||||
def _load_all_namespaces(resolver: URLResolver, parents: Tuple = ...) -> List[str]: ...
|
||||
|
||||
|
||||
def check_resolver(
|
||||
resolver: Union[URLResolver, URLPattern]
|
||||
) -> Union[List[Error], List[Warning]]: ...
|
||||
|
||||
|
||||
def check_url_config(app_configs: None, **kwargs) -> List[Warning]: ...
|
||||
|
||||
|
||||
def check_url_namespaces_unique(app_configs: None, **kwargs) -> List[Any]: ...
|
||||
|
||||
|
||||
def check_url_settings(app_configs: None, **kwargs) -> List[Error]: ...
|
||||
|
||||
|
||||
def get_warning_for_invalid_pattern(pattern: Tuple[str, Callable]) -> List[Error]: ...
|
||||
Reference in New Issue
Block a user