Update django_stubs_ext documentation to reference settings (#548)

This commit is contained in:
markedwards
2020-12-19 08:50:46 +00:00
committed by GitHub
parent 36d1778e2a
commit 47bd07758b
2 changed files with 4 additions and 4 deletions

View File

@@ -90,12 +90,12 @@ Install it:
pip install django-stubs-ext # as a production dependency pip install django-stubs-ext # as a production dependency
``` ```
And then place in your `manage.py`, `wsgi.py`, and `asgi.py` files: And then place in your top-level settings:
```python ```python
import django_stubs_ext import django_stubs_ext
django_stubs_ext.monkeypath() django_stubs_ext.monkeypatch()
``` ```
2. You can use strings instead: `'QuerySet[MyModel]'` and `'Manager[MyModel]'`, this way it will work as a type for `mypy` and as a regular `str` in runtime. 2. You can use strings instead: `'QuerySet[MyModel]'` and `'Manager[MyModel]'`, this way it will work as a type for `mypy` and as a regular `str` in runtime.

View File

@@ -20,10 +20,10 @@ In your Django application, use the following code:
```py ```py
import django_stubs_ext import django_stubs_ext
django_stubs_ext.monkeypath() django_stubs_ext.monkeypatch()
``` ```
This only needs to be called once, so the call to `monkeypatch` should be placed in your top-level urlconf. This only needs to be called once, so the call to `monkeypatch` should be placed in your top-level settings.
## Version compatibility ## Version compatibility