PEP-484 stubs for Django

Overview

mypy logo

pep484 stubs for Django

Build status Checked with mypy Gitter

This package contains type stubs and a custom mypy plugin to provide more precise static types and type inference for Django framework. Django uses some Python "magic" that makes having precise types for some code patterns problematic. This is why we need this project. The final goal is to be able to get precise types for most common patterns.

Installation

pip install django-stubs

To make mypy aware of the plugin, you need to add

[mypy]
plugins =
    mypy_django_plugin.main

[mypy.plugins.django-stubs]
django_settings_module = "myproject.settings"

in your mypy.ini or setup.cfg file.

Two things happeining here:

  1. We need to explicitly list our plugin to be loaded by mypy
  2. Our plugin also requires django settings module (what you put into DJANGO_SETTINGS_MODULE variable) to be specified

This fully working typed boilerplate can serve you as an example.

Version compatibility

We rely on different django and mypy versions:

django-stubs mypy version django version python version
1.7.0 0.790 2.2.x || 3.x ^3.6
1.6.0 0.780 2.2.x || 3.x ^3.6
1.5.0 0.770 2.2.x || 3.x ^3.6
1.4.0 0.760 2.2.x || 3.x ^3.6
1.3.0 0.750 2.2.x || 3.x ^3.6
1.2.0 0.730 2.2.x ^3.6
1.1.0 0.720 2.2.x ^3.6
0.12.x old semantic analyzer (<0.711), dmypy support 2.1.x ^3.6

FAQ

Is this an official Django project?

No, it is not. We are independent from Django at the moment. There's a proposal to merge our project into the Django itself. You can show your support by liking the PR.

Is it safe to use this in production?

Yes, it is! This project does not affect your runtime at all. It only affects mypy type checking process.

But, it does not make any sense to use this project without mypy.

mypy crashes when I run it with this plugin installed

Current implementation uses Django runtime to extract models information, so it will crash, if your installed apps or models.py is not correct. For this same reason, you cannot use reveal_type inside global scope of any Python file that will be executed for django.setup().

In other words, if your manage.py runserver crashes, mypy will crash too. You can also run mypy with --tb option to get extra information about the error.

I cannot use QuerySet or Manager with type annotations

You can get a TypeError: 'type' object is not subscriptable when you will try to use QuerySet[MyModel], Manager[MyModel] or some other Django-based Generic types.

This happens because these Django classes do not support __class_getitem__ magic method in runtime.

  1. You can go with our django_stubs_ext helper, that patches all the types we use as Generic in django.

Install it:

pip install django-stubs-ext  # as a production dependency

And then place in your top-level settings:

import django_stubs_ext

django_stubs_ext.monkeypatch()
  1. 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.

How can I create a HttpRequest that's guaranteed to have an authenticated user?

Django's built in HttpRequest has the attribute user that resolves to the type

Union[User, AnonymousUser]

where User is the user model specified by the AUTH_USER_MODEL setting.

If you want a HttpRequest that you can type-annotate with where you know that the user is authenticated you can subclass the normal HttpRequest class like so:

from django.http import HttpRequest
from my_user_app.models import MyUser

class AuthenticatedHttpRequest(HttpRequest):
    user: MyUser

And then use AuthenticatedHttpRequest instead of the standard HttpRequest for when you know that the user is authenticated. For example in views using the @login_required decorator.

Related projects

To get help

We have Gitter here: https://gitter.im/mypy-django/Lobby If you think you have more generic typing issue, please refer to https://github.com/python/mypy and their Gitter.

Contributing

This project is open source and community driven. As such we encourage contributions big and small. You can contribute by doing any of the following:

  1. Contribute code (e.g. improve stubs, add plugin capabilities, write tests etc) - to do so please follow the contribution guide.
  2. Assist in code reviews and discussions in issues.
  3. Identify bugs and issues and report these

You can always also reach out in gitter to discuss your contributions!

Comments
  • Implement support for `<QuerySet>.as_manager()`

    Implement support for `.as_manager()`

    I've reorganised and extended dynamic manager class generation to support <QuerySet>.as_manager().

    This also renames the dynamically generated manager types to align with what those class names will be during runtime, set by Django. See here: https://github.com/django/django/blob/b2eff16806057095c7dd3daa9402ad615e51627f/django/db/models/manager.py#L109-L110 That means that reveal_type(<Model>.<manager>) should output the same type name as type(<Model>.<manager>) (unless there's collisions etc etc.)

    Related issues

    Closes: #324

    opened by flaeppe 46
  • Requiring field annotations even though type can be inferred from field type

    Requiring field annotations even though type can be inferred from field type

    Right now mypy is complaining that my fields aren't annotated with types.

    Screen Shot 2019-04-18 at 8 11 05 AM

    Is this expected behavior? If so, why? Cant the type be inferred from the field value itself?

    Thanks!

    bug 
    opened by pirate 37
  • QuerySet.annotate improvements

    QuerySet.annotate improvements

    • QuerySet.annotate now returns correct self-type rather than QuerySet[Any]. Attribute access falls back to Any.
    • QuerySets that have an annotated model do not report errors during .filter() when called with invalid fields.
    • QuerySets that have an annotated model return ordinary dict rather than TypedDict for .values()
    • QuerySets that have an annotated model return Any rather than typed Tuple for .values_list()

    Calling QuerySet.annotate introduces an "annotated" model type which is a subtype of the original model dynamically (named "MyModel (annotated)"), but which allows arbitrary getting/setting of attributes.

    This is originally to fix this issue:

    a = MyModel.objects.filter()
    a = a.annotate() 
    

    error: Incompatible types in assignment (expression has type “QuerySet[Any]“, variable has type “Manager[Any]“)

    The problem is because of not using self-type

    opened by syastrov 33
  • Disable fallback to runtime types for Django settings

    Disable fallback to runtime types for Django settings

    This fallback to value.__class__ seems to be doing more harm than good; see #312 and #1162. Replace it with a clear error message that suggests a way to fix the problem rather than incompletely papering over it.

    opened by andersk 27
  •  Add fallback related manager in final iteration of AddRelatedManagers

    Add fallback related manager in final iteration of AddRelatedManagers

    If a django model has a Manager class that cannot be resolved statically (if it is generated in a way where we cannot import it, like objects = my_manager_factory()), we fallback to the default related manager, so you at least get a base level of working type checking.

    Closes https://github.com/typeddjango/django-stubs/issues/981, https://github.com/typeddjango/django-stubs/issues/969

    opened by aleksanb 25
  • Django 3.1 JSONField is missing

    Django 3.1 JSONField is missing

    Bug report

    What's wrong

    Django 3.1 adds a generic models.JSONField and fields.JSONField to replace the PostgreSQL-only versions: https://docs.djangoproject.com/en/3.1/releases/3.1/#jsonfield-for-all-supported-database-backends

    Attempting to use these new fields results in error: Module has no attribute "JSONField"

    How is that should be

    Type definitions should exist for the new imports. These can probably just be copied from the existing PostgreSQL versions.

    System information

    • OS:
    • python version: 3.8.5
    • django version: 3.1
    • mypy version: 0.770
    • django-stubs version: 1.5.0
    bug 
    opened by youngbob 25
  • user.is_staff complex type

    user.is_staff complex type

    Hello, as I am not sure if this is an issue related to django-stubs, or djangorestframework-stubs, or just my code, I am posting here as well. I created this issue https://github.com/typeddjango/djangorestframework-stubs/issues/109 Seems user.is_staff does not agree with the bool return type annotation I gave to my method. Is this an issue for fixing in django-stubs or djangorestframework-stubs? If it is an issue of my code, please suggest what I could do.

    bug 
    opened by amikrop 22
  • Add failing test for `Name

    Add failing test for `Name "Sequence" is not defined` false positive

    Problem: There seems to be a bug in this code, but the current tests don't fail.

    Solution: Add a new failing test.

    Fixes: ~https://github.com/typeddjango/django-stubs/issues/709#issuecomment-1158667013~ #1022

    opened by christianbundy 20
  • mypy crashes with `TypeError: Object of type AnyType is not JSON serializable`

    mypy crashes with `TypeError: Object of type AnyType is not JSON serializable`

    Bug report

    mypy crashes at the end of successful check trying to write cache. Not sure if that's django-stubs problem and can't test if mypy works without django-stubs because of many type checks errors mypy doesn't write cache at the end.

    What's wrong

      File "/opt/hostedtoolcache/Python/3.9.6/x64/bin/mypy", line 8, in <module>
        sys.exit(console_entry())
      File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/mypy/__main__.py", line 11, in console_entry
        main(None, sys.stdout, sys.stderr)
      File "mypy/main.py", line 87, in main
      File "mypy/main.py", line 165, in run_build
      File "mypy/build.py", line 179, in build
      File "mypy/build.py", line 254, in _build
      File "mypy/build.py", line 2697, in dispatch
      File "mypy/build.py", line 3021, in process_graph
      File "mypy/build.py", line 3138, in process_stale_scc
      File "mypy/build.py", line 2288, in write_cache
      File "mypy/build.py", line 1476, in write_cache
      File "mypy/build.py", line 1428, in json_dumps
      File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/json/__init__.py", line 234, in dumps
        return cls(
      File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/json/encoder.py", line 199, in encode
        chunks = self.iterencode(o, _one_shot=True)
      File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/json/encoder.py", line 257, in iterencode
        return _iterencode(o, 0)
      File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/json/encoder.py", line 179, in default
        raise TypeError(f'Object of type {o.__class__.__name__} '
    TypeError: Object of type AnyType is not JSON serializable
    

    System information

    • OS:
    • python version: 3.9.6
    • django version: 3.2.7
    • mypy version: 0.910
    • django-stubs version: 1.9.0
    bug 
    opened by kalekseev 19
  • Output a more clear configuration error

    Output a more clear configuration error

    I have made things!

    This tackles #420; missing configuration is now reported like this:

    (django-stubs-3.6.11) ➜  django-stubs issue-420 ✗ mypy -p django-stubs --config-file test-data/plugins.ini                                                                                                                                    
    usage: (config)
    ...
    [mypy.plugins.django_stubs]
        django_settings_module: str (required)
    ...
    (django-stubs) mypy: error: 'django_settings_module' is not set: no section [mypy.plugins.django-stubs]
    

    The function got refactored a little bit and made a little less verbose. I thought this way it will be easier to add new configuration options (a solution to #417 which is on the way for example).

    Related issues

    • Closes #420
    opened by snejus 19
  • AssertionError when using models.Manager

    AssertionError when using models.Manager

    Bug report

    What's wrong

    I can't seem to create a minimal example demonstrating this, but I'm getting this on one of my projects.

    If I change a custom queryset to become a custom manager by changing what it inherits from and changing objects = CustomQuerySet.as_manager() to objects = CustomManager() I get the following.

    Traceback (most recent call last):
      File "c:\users\dusti\.pyenv\pyenv-win\versions\3.8.0-amd64\lib\runpy.py", line 192, in _run_module_as_main
        return _run_code(code, main_globals, None,
        exec(code, run_globals)
      File "mypy\semanal.py", line 4679, in accept
      File "mypy\nodes.py", line 939, in accept
      File "mypy\semanal.py", line 1001, in visit_class_def
      File "mypy\semanal.py", line 1078, in analyze_class
      File "mypy\semanal.py", line 1087, in analyze_class_body_common
      File "mypy\semanal.py", line 1147, in apply_class_plugin_hooks
      File "c:\users\dusti\appdata\local\pypoetry\cache\virtualenvs\vehicles-caet0sxz-py3.8\lib\site-packages\mypy_django_plugin\main.py", line 37, in transform_model_class
        process_model_class(ctx, django_context)
      File "c:\users\dusti\appdata\local\pypoetry\cache\virtualenvs\vehicles-caet0sxz-py3.8\lib\site-packages\mypy_django_plugin\transformers\models.py", line 357, in process_model_class
        initializer_cls(ctx, django_context).run()
      File "c:\users\dusti\appdata\local\pypoetry\cache\virtualenvs\vehicles-caet0sxz-py3.8\lib\site-packages\mypy_django_plugin\transformers\models.py", line 71, in run
        self.run_with_model_cls(model_cls)
      File "c:\users\dusti\appdata\local\pypoetry\cache\virtualenvs\vehicles-caet0sxz-py3.8\lib\site-packages\mypy_django_plugin\transformers\models.py", line 230, in run_with_model_cls
        custom_manager_type = self.create_new_model_parametrized_manager(custom_model_manager_name,
      File "c:\users\dusti\appdata\local\pypoetry\cache\virtualenvs\vehicles-caet0sxz-py3.8\lib\site-packages\mypy_django_plugin\transformers\models.py", line 183, in create_new_model_parametrized_manager
        helpers.copy_method_to_another_class(new_cls_def_context,
      File "c:\users\dusti\appdata\local\pypoetry\cache\virtualenvs\vehicles-caet0sxz-py3.8\lib\site-packages\mypy_django_plugin\lib\helpers.py", line 346, in copy_method_to_another_class
        assert bound_return_type is not None
    AssertionError:
    
    • OS: Win10
    • python version: 3.8
    • django version: 3.0.6
    • mypy version: .770
    • django-stubs version: 1.5.0
    bug 
    opened by dmwyatt 14
  • Improve GeoDjango type-hints

    Improve GeoDjango type-hints

    I have made things!

    • Provide more specific type-hints for GeoDjango modules.
    • Fixed some missing imports in contrib/gis/**/__init__.py

    Related issues

    No

    opened by ciscorn 1
  • Add typing for data parameter in get from RequestFactory, test Client and urlencode

    Add typing for data parameter in get from RequestFactory, test Client and urlencode

    … and urlencode

    Following on https://github.com/typeddjango/djangorestframework-stubs/pull/267 by adding the same typing information to the corresponding django stubs.

    The data parameter in both get methods is fed to urlencode, and that function takes either a mapping or a list of tuples of URL parameters.

    opened by nils-van-zuijlen 0
  • The stub for AbstractBaseSession() get_decoded() is Dict[str, int] but should include str

    The stub for AbstractBaseSession() get_decoded() is Dict[str, int] but should include str

    Bug report

    I found a wrong stub.

    What's wrong

    The file base_session.pyi contains the stubs for AbstractBaseSession. The stub for the method get_decoded is wrong. It is Dict[str, int] but obviously the decoded session can also contain strings.

    How is that should be

    Steps to reproduce:

    1. Have any django project running with session login.
    2. Login so that there is at least one session in the database.
    3. Open the python shell with python manage.py shell

    Run the following code from within the shell:

    from django.contrib.sessions.models import Session
    s = Session.objects.first()
    s.get_decoded()
    
    # Example response:
    # {'_auth_user_id': '1', '_auth_user_backend': 'django.contrib.auth.backends.ModelBackend', '_auth_user_hash': '1c92e5298f2609bd14615aef4f2bd07a13a7e741b8acc475623ae3f1386d4879'}
    

    As you can see event the auth_user_id is a string. Therefore I think the stub should be Dict[str, str] but at the moment I'm not sure if it can include numbers, so Dict[str, Union[str, int]] might also be correct.

    System information

    django-stubs==1.13.0

    bug good first issue stubs 
    opened by danielmoessner 2
  • New problem when typing custom `Model.objects` in version 1.13.1

    New problem when typing custom `Model.objects` in version 1.13.1

    Bug report

    What's wrong

    After updating to version 1.13.1 I've add a new typing problem appear in my models file. Here is a simplistic version. This file contains two models A and B that can point to each other.

    from typing import TypeVar
    from django.db import models
    
    T = TypeVar("T", bound=models.Model)
    
    class MyQuerySet(models.QuerySet[T]):
        pass
    
    class MyModelA(models.Model):
        objects = MyQuerySet.as_manager()
    
        modelB = models.ForeignKey("MyModelB", on_delete=models.CASCADE)
    
    class MyModelB(models.Model):
        modelA = models.ForeignKey(MyModelA, null=True, blank=True, on_delete=models.SET_NULL)
    

    With version 1.13.0 this passes fine, but with 1.13.1 mypy raises an error:

    error: Need type annotation for "objects"  [var-annotated]
    

    This initial problem can be solved by adding a type annotation:

    class MyModelA(models.Model):
        objects: "models.Manager[MyModelA]" = MyQuerySet.as_manager()
    

    However that wasn't necessary in the previous version. Moreover this new annotation leads mypy to raise a new error :

    error: Couldn't resolve related manager for relation 'mymodela' (from myapp.models.MyModelA.myapp.MyModelA.modelB).  [django-manager-missing]
    

    This new error is present in both versions 1.13.1 and 1.13.0. I don't know how to fix that one.

    How is that should be

    I'd expect the annotation to be unneeded as it wasn't in the previous version and it seems clear enough.

    With the annotation I would also expect no error here, as my models should be well-typed, and the code runs fine.

    System information

    • OS: Kubuntu 22.10
    • python version: 3.10.7
    • django version: 4.1.4
    • mypy version: 0.991
    • django-stubs version: 1.13.1 (worked on 1.13.0)
    • django-stubs-ext version: 0.7.0
    bug regression 
    opened by dlesbre 1
  • Missing class PyMemcacheCache in core/cache/backends/memcached.pyi

    Missing class PyMemcacheCache in core/cache/backends/memcached.pyi

    Bug report

    What's wrong

    In Django 3.2+ source code in core/cache/backends/memcached.py there's:

    class PyMemcacheCache(BaseMemcachedCache):
        """An implementation of a cache binding using pymemcache."""
        def __init__(self, server, params):
            import pymemcache.serde
            super().__init__(server, params, library=pymemcache, value_not_found_exception=KeyError)
            self._class = self._lib.HashClient
            self._options = {
                'allow_unicode_keys': True,
                'default_noreply': False,
                'serde': pymemcache.serde.pickle_serde,
                **self._options,
            }
    

    but in stubs in core/cache/backends/memcached.pyi there is no stub for PyMemcacheCache.

    How is that should be

    I believe the missing part in core/cache/backends/memcached.pyi is:

    class PyMemcacheCache(BaseMemcachedCache):
        def __init__(self, server: Union[str, Sequence[str]], params: Dict[str, Any]) -> None: ...
    

    System information

    • OS:
    • python version: 3.8.13
    • django version: 3.2.16
    • mypy version: 0.991
    • django-stubs version: 1.13.0
    • django-stubs-ext version: 0.7.0
    bug good first issue stubs 
    opened by skrese 0
  • Dynamic settings fail as of 1.13.0

    Dynamic settings fail as of 1.13.0

    Bug report

    What's wrong

    We build Django settings dynamically, instead of using a settings.py file with static properties. This worked fine with django-stubs up until 1.13.0, but all of our settings fail with 1.13.0:

    'Settings' object has no attribute 'FOO'
    

    This seems to be caused by #1163.

    How is that should be

    I understand the reasoning given in #1163, but we are pinned at django-stubs 1.12.0 and would have to completely reimplement our installation in order to unblock. Can dynamically-constructed settings be supported with django-stubs, or is that door permanently closed? Maybe it could be a non-default option we could enable, accepting the potential downsides?

    System information

    • OS:
    • python version: 3.10.8
    • django version: 4.1.3
    • mypy version: 0.991
    • django-stubs version: 1.13.0
    • django-stubs-ext version: 0.7.0
    bug mypy-plugin regression 
    opened by markedwards 1
Releases(1.13.1)
  • 1.13.1(Dec 8, 2022)

    What's Changed

    • Fix types for sessions by @ljodal in https://github.com/typeddjango/django-stubs/pull/1173
    • Add SQLite backend is_in_memory_db() functions by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1218
    • Introduce QuerySetAny type for QuerySet isinstance checks by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1199
    • Add LANGUAGE_COOKIE_* settings by @andersk in https://github.com/typeddjango/django-stubs/pull/1228
    • move _default_manager to ModelBase by @clouds56 in https://github.com/typeddjango/django-stubs/pull/1150
    • Support more use cases of gettext_lazy. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1233
    • Prefetch attributes by @g-as in https://github.com/typeddjango/django-stubs/pull/1234
    • Typehint common dunder methods by @intgr in https://github.com/typeddjango/django-stubs/pull/1238
    • Add Optional to LANGUAGE_COOKIE_SAMESITE by @andersk in https://github.com/typeddjango/django-stubs/pull/1246
    • Add django.db.models.query.BaseIterable and subclasses by @joshua-jandyco in https://github.com/typeddjango/django-stubs/pull/1242
    • Add Django 4.1 constraints violation_error_message by @martinlehoux in https://github.com/typeddjango/django-stubs/pull/1263
    • Type ModelAdmin.fieldsets 'description' option to support gettext_lazy by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1268
    • Type hint improvements for string promises, manager, query set by @benspaulding in https://github.com/typeddjango/django-stubs/pull/1272
    • update django.contrib.messages to use _StrOrPromise by @terencehonles in https://github.com/typeddjango/django-stubs/pull/1274
    • Add Django 4.0 trigram word classes by @michael-lazar in https://github.com/typeddjango/django-stubs/pull/1278

    Fixes

    • Fix hasattr(settings) AssertionError with mypy 0.990 by @intgr in https://github.com/typeddjango/django-stubs/pull/1239

    Housekeeping

    • Fix stackoverflow badge by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1230
    • revert changes in #1252 leaked into master by @hoefling in https://github.com/typeddjango/django-stubs/pull/1255
    • Version 1.13.1 release by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1241

    Continuous integration

    • Enable pre-commit.ci by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1222
    • Cancel old pipelines by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1226
    • Run pre-commit only on pre-commit.ci by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1250
    • Run checks against Django 4.1 and Python 3.11 by @michael-k in https://github.com/typeddjango/django-stubs/pull/1223
    • Introduce flake8-pyi in pre-commit checks by @hoefling in https://github.com/typeddjango/django-stubs/pull/1253
    • Pin flake8-pyi to 22.10.0 by @hoefling in https://github.com/typeddjango/django-stubs/pull/1254
    • revert changes done in #1253 that satisfy Y041, disable Y041 rule by @hoefling in https://github.com/typeddjango/django-stubs/pull/1256
    • Fix CI: Update flake8-pyi by @intgr in https://github.com/typeddjango/django-stubs/pull/1279

    Dependency updates

    • [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/1236
    • [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/1258
    • [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/1275
    • [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/1281

    New Contributors

    • @clouds56 made their first contribution in https://github.com/typeddjango/django-stubs/pull/1150
    • @pre-commit-ci made their first contribution in https://github.com/typeddjango/django-stubs/pull/1236
    • @joshua-jandyco made their first contribution in https://github.com/typeddjango/django-stubs/pull/1242
    • @martinlehoux made their first contribution in https://github.com/typeddjango/django-stubs/pull/1263
    • @benspaulding made their first contribution in https://github.com/typeddjango/django-stubs/pull/1272
    • @michael-lazar made their first contribution in https://github.com/typeddjango/django-stubs/pull/1278

    Full Changelog: https://github.com/typeddjango/django-stubs/compare/1.13.0...1.13.1

    Source code(tar.gz)
    Source code(zip)
  • 1.13.0(Nov 3, 2022)

    What's Changed

    • Set generic type of SimpleCookie by @w0rp in https://github.com/typeddjango/django-stubs/pull/1018
    • Update RunSQL type to include parametrized sql by @lachtanek in https://github.com/typeddjango/django-stubs/pull/1015
    • BaseContext.copy by @smithdc1 in https://github.com/typeddjango/django-stubs/pull/1012
    • Add missing type for TestCase.captureOnCommitCallbacks by @lachtanek in https://github.com/typeddjango/django-stubs/pull/1016
    • Fix nullability of blank charfields in values and values_list by @ljodal in https://github.com/typeddjango/django-stubs/pull/1020
    • Improved type of template.loader.get_template() by @smithdc1 in https://github.com/typeddjango/django-stubs/pull/1011
    • Bump black from 22.3.0 to 22.6.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1027
    • Fix logger type in all modules by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1031
    • Support cursor.execute(psycopg2.sql.Composable) by @andersk in https://github.com/typeddjango/django-stubs/pull/1029
    • Bump requests from 2.28.0 to 2.28.1 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1035
    • Improved return type of render_to_string(). by @smithdc1 in https://github.com/typeddjango/django-stubs/pull/1036
    • Resolve all queryset methods on managers as attributes by @ljodal in https://github.com/typeddjango/django-stubs/pull/1028
    • Populate model argument for dynamically created managers by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1033
    • Fix type stubs for EmptyManager by @ljodal in https://github.com/typeddjango/django-stubs/pull/1039
    • Improve stubs with minor fixes by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1038
    • Monkeypatch some more generics. by @ngnpope in https://github.com/typeddjango/django-stubs/pull/1050
    • Bump pre-commit from 2.19.0 to 2.20.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1057
    • Use _AsSqlType for as_sql by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1052
    • Made BaseContext setitem and getitem consistant. by @smithdc1 in https://github.com/typeddjango/django-stubs/pull/1040
    • Add support for inline from_queryset in model classes by @ljodal in https://github.com/typeddjango/django-stubs/pull/1045
    • Improve typing for unresolved managers by @ljodal in https://github.com/typeddjango/django-stubs/pull/1044
    • Use a more general type for django.core.mail.send_mass_mail's datatuple by @jhhayashi in https://github.com/typeddjango/django-stubs/pull/1062
    • Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1070
    • Improve type annotation of DiscoverRunner. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1069
    • Fix overloads and remove PathLike in finders by @andersk in https://github.com/typeddjango/django-stubs/pull/1063
    • Fix type annotation of message_dict. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1073
    • Tighten management.get_commands type by @andersk in https://github.com/typeddjango/django-stubs/pull/1074
    • Improve stubs for contrib.postgres.operations. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1071
    • Improve type for @require_http_methods by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1075
    • Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1076
    • Support Lookup generics. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1079
    • Fix OutputWrapper.style_func type by @andersk in https://github.com/typeddjango/django-stubs/pull/1080
    • Fix type of min_value and max_value on FloatField by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1081
    • docs(README): Fix indentation in list and examples by @tony in https://github.com/typeddjango/django-stubs/pull/1083
    • Remove trailing whitespace in README to fix CI failure by @andersk in https://github.com/typeddjango/django-stubs/pull/1084
    • Fix CI error introduced since Django 4.1 by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1093
    • Add preset options list to makemessages command. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1091
    • Improve type annotation for RunSQL by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1090
    • Fix base_field type for SimpleArrayField by @adnathanail in https://github.com/typeddjango/django-stubs/pull/1097
    • Prevent building an editable wheel with setuptools<64 by @andersk in https://github.com/typeddjango/django-stubs/pull/1123
    • Improve hints for BaseCache by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1117
    • Add HttpResponseBase.contains by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1099
    • Add BaseDatabaseWrapper.operators by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1119
    • Add SimpleTestCase.assertURLEqual() by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1102
    • Allow None to be passed to Paginator.get_page by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1101
    • Improve types for CheckMessage subclasses by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1107
    • Expose HttpResponseBase in django.http by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1121
    • Improve types for DiscoverRunner by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1106
    • Improve return type for BaseCommand.execute() by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1104
    • Fix CI by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1108
    • Improve type hints for test client response.context by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1100
    • Add test client response.redirect_chain by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1124
    • Add different signatures for form assertions from Django 4.1 by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1105
    • Run stubs self-check on all python versions by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1126
    • Add database Field.non_db_attrs by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1125
    • Rewrite SessionBase properties to use @property by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1129
    • Add db Field.flatchoices by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1128
    • Add HttpRequest current_app and LANGUAGE_CODE attrs by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1127
    • Updating deconstructible by @karolyi in https://github.com/typeddjango/django-stubs/pull/1116
    • Type samesite values as literals 'Lax', 'Strict' or 'None' by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1110
    • Enhance stubs for csrf decorators. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1130
    • Return Promise for lazy functions. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/689
    • Add async queryset for Django 4.1 by @xncbf in https://github.com/typeddjango/django-stubs/pull/1131
    • Add Q.xor by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1133
    • Improve database backend types by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1132
    • Improve types for QuerySet.contains and bulk_create by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1134
    • Fix Manager.contains and bulk_create by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1135
    • Add QuerySet.aiter() by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1136
    • Fix return type for django.shortcuts.render by @SebastiaanZ in https://github.com/typeddjango/django-stubs/pull/1140
    • Bump black from 22.6.0 to 22.8.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1141
    • Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1142
    • fix type hint for GenericSitemap(info_dict) by @djbrown in https://github.com/typeddjango/django-stubs/pull/1111
    • Reflect the deprecation of get_response being None. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1086
    • Add django.db.models.functions.Collate by @syre in https://github.com/typeddjango/django-stubs/pull/1143
    • Bump pytest from 7.1.2 to 7.1.3 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1144
    • Correct EmailMultiAlternatives.body by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1146
    • Add type and parameter fields to MediaType by @yrd in https://github.com/typeddjango/django-stubs/pull/1103
    • Improve Flake8 config by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1149
    • Serialize RelatedManager attributes in cache by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1152
    • Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1153
    • Adjust choices= type variance for model fields by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1154
    • Broaden type annotation for verbose_name(_plural) to accept lazystr. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1139
    • Improve stubs for runserver management command. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1037
    • Relax fields= arg for refresh_from_db to accept Sequence by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1156
    • Fix paramters for ParallelTestSuite and RemoteTestRunner. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1072
    • Fix unresolved placeholder error during serialization by @ljodal in https://github.com/typeddjango/django-stubs/pull/1161
    • Disable fallback to runtime types for Django settings by @andersk in https://github.com/typeddjango/django-stubs/pull/1163
    • Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1164
    • Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1165
    • Update mypy to 0.981 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1167
    • Allow Promise to be passed to ArrayField.verbose_name by @ljodal in https://github.com/typeddjango/django-stubs/pull/1168
    • Disallow passing bytes for Field verbose_name by @intgr in https://github.com/typeddjango/django-stubs/pull/1170
    • Don't allow promise to be passed to ArrayField.name by @ljodal in https://github.com/typeddjango/django-stubs/pull/1171
    • Implement support for <QuerySet>.as_manager() by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1025
    • Add SETTINGS_MODULE to Settings and LazySettings by @ljodal in https://github.com/typeddjango/django-stubs/pull/1175
    • Fix type of _id when using ForeignKey(to_field=) by @intgr in https://github.com/typeddjango/django-stubs/pull/1176
    • Add UUIDField lookup types by @intgr in https://github.com/typeddjango/django-stubs/pull/1178
    • Reparametrize managers without explicit type parameters by @ljodal in https://github.com/typeddjango/django-stubs/pull/1169
    • Bump mypy from 0.981 to 0.982 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1180
    • Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1181
    • Add missing re-export for JSONObject. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1182
    • Update utils.log.log_response type for Django 4.1 by @andersk in https://github.com/typeddjango/django-stubs/pull/1183
    • Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1186
    • Bump gitpython from 3.1.27 to 3.1.28 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1185
    • Bump black from 22.8.0 to 22.10.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1184
    • Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1188
    • Bump gitpython from 3.1.28 to 3.1.29 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1187
    • Fix RelatedManager not callable by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1191
    • Update cache timeout parameters to floats by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1193
    • Standardize all context manager exit methods by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1194
    • Add hints for instance variables in console.EmailBackend by @leamingrad in https://github.com/typeddjango/django-stubs/pull/1200
    • Generic sitemap by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1198
    • Allow assertQuerysetEqual to compare with a collection of values by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1201
    • Improve type of TestCase.captureOnCommitCallbacks by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1202
    • Bump pytest-mypy-plugins from 1.10.0 to 1.10.1 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1205
    • Bump pytest from 7.1.3 to 7.2.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1203
    • Add auto_now attrs to date and time model fields by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1210
    • Add django.db.models.base.model_unpickle by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1209
    • Add BaseDetailView.object by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1211
    • Add BaseDatabaseSchemaEditor.table_sql() by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1212
    • Add lots of missing argument & return type hints by @intgr in https://github.com/typeddjango/django-stubs/pull/1204
    • Fixed F's asc and desc args by @g-as in https://github.com/typeddjango/django-stubs/pull/1213
    • BaseDeleteView now extends FormMixin by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1215
    • Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1216
    • Add type hints to all test code by @intgr in https://github.com/typeddjango/django-stubs/pull/1217
    • Fill remaining missing hints with Any & disallow partial hints by @intgr in https://github.com/typeddjango/django-stubs/pull/1206
    • Remove bad redirect_chain attributes by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1148
    • Re-allow expressions in UniqueConstraint by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1220
    • Add some types to views by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1221

    New Contributors

    • @lachtanek made their first contribution in https://github.com/typeddjango/django-stubs/pull/1015
    • @smithdc1 made their first contribution in https://github.com/typeddjango/django-stubs/pull/1012
    • @ngnpope made their first contribution in https://github.com/typeddjango/django-stubs/pull/1050
    • @jhhayashi made their first contribution in https://github.com/typeddjango/django-stubs/pull/1062
    • @UnknownPlatypus made their first contribution in https://github.com/typeddjango/django-stubs/pull/1081
    • @tony made their first contribution in https://github.com/typeddjango/django-stubs/pull/1083
    • @adnathanail made their first contribution in https://github.com/typeddjango/django-stubs/pull/1097
    • @karolyi made their first contribution in https://github.com/typeddjango/django-stubs/pull/1116
    • @SebastiaanZ made their first contribution in https://github.com/typeddjango/django-stubs/pull/1140
    • @djbrown made their first contribution in https://github.com/typeddjango/django-stubs/pull/1111
    • @syre made their first contribution in https://github.com/typeddjango/django-stubs/pull/1143
    • @yrd made their first contribution in https://github.com/typeddjango/django-stubs/pull/1103

    Full Changelog: https://github.com/typeddjango/django-stubs/compare/[email protected]

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Jun 17, 2022)

    What's Changed

    • Upgrade mypy support to 0.960 by @DamianZaremba in https://github.com/typeddjango/django-stubs/pull/973
    • Fix false positive ModelAdmin.list_display_links=None by @AllexVeldman in https://github.com/typeddjango/django-stubs/pull/964
    • Fix AlterModelManagers managers annotation to be [(str, Manager), ...] by @alexdutton in https://github.com/typeddjango/django-stubs/pull/966
    • Support content attribute for a Testing Response. by @quinox in https://github.com/typeddjango/django-stubs/pull/968
    • Fix BaseModelFormSet.save_m2m: accept self by @blueyed in https://github.com/typeddjango/django-stubs/pull/970
    • Move mypy version upper bound to a [compatible-mypy] extra by @andersk in https://github.com/typeddjango/django-stubs/pull/979
    • Add GitHub release action to upload to PyPI & create GitHub release by @terencehonles in https://github.com/typeddjango/django-stubs/pull/980
    • Bump mypy from 0.960 to 0.961 by @dependabot in https://github.com/typeddjango/django-stubs/pull/983
    • Improve admin filter types by @adamchainz in https://github.com/typeddjango/django-stubs/pull/984
    • remove unneeded submodule (removed in #485) by @terencehonles in https://github.com/typeddjango/django-stubs/pull/982
    • Remove coreapi from requirements.txt by @jzmiller1 in https://github.com/typeddjango/django-stubs/pull/987
    • Enable GitHub auto generated release notes for GitHub releases by @terencehonles in https://github.com/typeddjango/django-stubs/pull/988
    • Bump requests from 2.27.1 to 2.28.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/990
    • Bump actions/setup-python from 3 to 4 by @dependabot in https://github.com/typeddjango/django-stubs/pull/989
    • Improve admin filter lookups() return type by @adamchainz in https://github.com/typeddjango/django-stubs/pull/992
    • Fix manager types scope by @sterliakov in https://github.com/typeddjango/django-stubs/pull/991
    • Add fallback related manager in final iteration of AddRelatedManagers by @aleksanb in https://github.com/typeddjango/django-stubs/pull/993
    • Improve hints in migration Operation class by @intgr in https://github.com/typeddjango/django-stubs/pull/996
    • Set type of default django.core.cache.cache to BaseCache by @flaeppe in https://github.com/typeddjango/django-stubs/pull/998
    • Add Feed to monkeypatch to fix generic issue. by @adambirds in https://github.com/typeddjango/django-stubs/pull/1002
    • Emit error and set fallback type for managers that can't be resolved by @flaeppe in https://github.com/typeddjango/django-stubs/pull/999

    New Contributors

    • @AllexVeldman made their first contribution in https://github.com/typeddjango/django-stubs/pull/964
    • @alexdutton made their first contribution in https://github.com/typeddjango/django-stubs/pull/966
    • @andersk made their first contribution in https://github.com/typeddjango/django-stubs/pull/979
    • @jzmiller1 made their first contribution in https://github.com/typeddjango/django-stubs/pull/987
    • @adambirds made their first contribution in https://github.com/typeddjango/django-stubs/pull/1002

    Full Changelog: https://github.com/typeddjango/django-stubs/compare/[email protected]

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Jun 17, 2022)

    What's Changed

    • Upgrade mypy support to 0.960 by @DamianZaremba in https://github.com/typeddjango/django-stubs/pull/973
    • Fix false positive ModelAdmin.list_display_links=None by @AllexVeldman in https://github.com/typeddjango/django-stubs/pull/964
    • Fix AlterModelManagers managers annotation to be [(str, Manager), ...] by @alexdutton in https://github.com/typeddjango/django-stubs/pull/966
    • Support content attribute for a Testing Response. by @quinox in https://github.com/typeddjango/django-stubs/pull/968
    • Fix BaseModelFormSet.save_m2m: accept self by @blueyed in https://github.com/typeddjango/django-stubs/pull/970
    • Move mypy version upper bound to a [compatible-mypy] extra by @andersk in https://github.com/typeddjango/django-stubs/pull/979
    • Add GitHub release action to upload to PyPI & create GitHub release by @terencehonles in https://github.com/typeddjango/django-stubs/pull/980
    • Bump mypy from 0.960 to 0.961 by @dependabot in https://github.com/typeddjango/django-stubs/pull/983
    • Improve admin filter types by @adamchainz in https://github.com/typeddjango/django-stubs/pull/984
    • remove unneeded submodule (removed in #485) by @terencehonles in https://github.com/typeddjango/django-stubs/pull/982
    • Remove coreapi from requirements.txt by @jzmiller1 in https://github.com/typeddjango/django-stubs/pull/987
    • Enable GitHub auto generated release notes for GitHub releases by @terencehonles in https://github.com/typeddjango/django-stubs/pull/988
    • Bump requests from 2.27.1 to 2.28.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/990
    • Bump actions/setup-python from 3 to 4 by @dependabot in https://github.com/typeddjango/django-stubs/pull/989
    • Improve admin filter lookups() return type by @adamchainz in https://github.com/typeddjango/django-stubs/pull/992
    • Fix manager types scope by @sterliakov in https://github.com/typeddjango/django-stubs/pull/991
    • Add fallback related manager in final iteration of AddRelatedManagers by @aleksanb in https://github.com/typeddjango/django-stubs/pull/993
    • Improve hints in migration Operation class by @intgr in https://github.com/typeddjango/django-stubs/pull/996
    • Set type of default django.core.cache.cache to BaseCache by @flaeppe in https://github.com/typeddjango/django-stubs/pull/998
    • Add Feed to monkeypatch to fix generic issue. by @adambirds in https://github.com/typeddjango/django-stubs/pull/1002
    • Emit error and set fallback type for managers that can't be resolved by @flaeppe in https://github.com/typeddjango/django-stubs/pull/999

    New Contributors

    • @AllexVeldman made their first contribution in https://github.com/typeddjango/django-stubs/pull/964
    • @alexdutton made their first contribution in https://github.com/typeddjango/django-stubs/pull/966
    • @andersk made their first contribution in https://github.com/typeddjango/django-stubs/pull/979
    • @jzmiller1 made their first contribution in https://github.com/typeddjango/django-stubs/pull/987
    • @adambirds made their first contribution in https://github.com/typeddjango/django-stubs/pull/1002

    Full Changelog: https://github.com/typeddjango/django-stubs/compare/[email protected]

    Source code(tar.gz)
    Source code(zip)
  • v1.11.0(May 24, 2022)

  • v1.5.0(Mar 14, 2020)

  • 1.4.0(Dec 17, 2019)

  • 1.3.3(Dec 17, 2019)

  • 1.3.2(Dec 13, 2019)

  • v1.3.1(Dec 12, 2019)

    • Add support for BaseManager.from_queryset()
    • Better support for new Django 3.0 features
    • Fix values(), values_list() with ManyToManyField
    • Annotations improvements
    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Dec 6, 2019)

  • v1.2.0(Oct 5, 2019)

    New features

    • Support for filter/get/exclude arguments typechecking
    • Recognize third-party base Model classes
    • Compatibility with mypy==0.730
    • Better support for django.contrib.auth model classes
    • No need for PYTHONPATH = ${pwd}:$PYTHONPATH anymore for mypy execution

    and lots of bugfixes and stub improvements

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Aug 24, 2019)

  • 1.0.2(Jul 26, 2019)

  • 1.0.1(Jul 26, 2019)

  • 1.0.0(Jul 25, 2019)

    All previous config option are dropped, see https://github.com/typeddjango/django-stubs#warning-all-configuration-from-pre-100-versions-is-dropped-use-one-below for the new configuration of the plugin and some release details

    Source code(tar.gz)
    Source code(zip)
  • v0.12.1(Apr 15, 2019)

  • v0.12.0(Apr 13, 2019)

    • Fix compatibility with mypy==0.700
    • Check if unknown attributes are invoked on model instances. Add ignore_missing_model_attributes flag to control this behaviour
    Source code(tar.gz)
    Source code(zip)
  • v0.11.1(Apr 1, 2019)

  • v0.11.0(Mar 31, 2019)

    • Fix SessionBase.exists() return type
    • Fix @classproperty
    • Improve typechecking of Model attributes of functions, thanks to @syastrov
    class A(models.Model):
        pass
    class B(models.Model):
        pass
    def service(a: A) -> int:
        pass
    service(B())   # now it fails
    
    Source code(tar.gz)
    Source code(zip)
  • v0.10.0(Mar 25, 2019)

    • Support for proper return types of values() and values_list, thanks to @syastrov.
    • Add all reimports for forms.__init__.pyi.
    • Make constructor annotations for django.core.validators classes less specific, thanks to @kalekseev.
    • Fix many false positives inside the stubs itself.
    Source code(tar.gz)
    Source code(zip)
  • v0.9.0(Mar 10, 2019)

    • Support returning the correct values for the different QuerySet methods when using .values() and .values_list(). Contributed by @syastrov
    • Fix type errors on other models' managers when using objects = models.Manager() in Model. Contributed by @syastrov
    • Add gzip_page decorator. Contributed by @mattbasta
    Source code(tar.gz)
    Source code(zip)
  • v0.8.2(Mar 6, 2019)

  • v0.8.1(Mar 5, 2019)

Owner
TypedDjango
We make types for Django framework!
TypedDjango
Django URL Shortener is a Django app to to include URL Shortening feature in your Django Project

Django URL Shortener Django URL Shortener is a Django app to to include URL Shortening feature in your Django Project Install this package to your Dja

Rishav Sinha 4 Nov 18, 2021
Meta package to combine turbo-django and stimulus-django

Hotwire + Django This repository aims to help you integrate Hotwire with Django ?? Inspiration might be taken from @hotwired/hotwire-rails. We are sti

Hotwire for Django 31 Aug 9, 2022
django-reversion is an extension to the Django web framework that provides version control for model instances.

django-reversion django-reversion is an extension to the Django web framework that provides version control for model instances. Requirements Python 3

Dave Hall 2.8k Jan 2, 2023
Django-environ allows you to utilize 12factor inspired environment variables to configure your Django application.

Django-environ django-environ allows you to use Twelve-factor methodology to configure your Django application with environment variables. import envi

Daniele Faraglia 2.7k Jan 7, 2023
Rosetta is a Django application that eases the translation process of your Django projects

Rosetta Rosetta is a Django application that facilitates the translation process of your Django projects. Because it doesn't export any models, Rosett

Marco Bonetti 909 Dec 26, 2022
Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.

Cookiecutter Django Powered by Cookiecutter, Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly. Documentati

Daniel Feldroy 10k Dec 31, 2022
Django project starter on steroids: quickly create a Django app AND generate source code for data models + REST/GraphQL APIs (the generated code is auto-linted and has 100% test coverage).

Create Django App ?? We're a Django project starter on steroids! One-line command to create a Django app with all the dependencies auto-installed AND

imagine.ai 68 Oct 19, 2022
django-quill-editor makes Quill.js easy to use on Django Forms and admin sites

django-quill-editor django-quill-editor makes Quill.js easy to use on Django Forms and admin sites No configuration required for static files! The ent

lhy 139 Dec 5, 2022
A Django chatbot that is capable of doing math and searching Chinese poet online. Developed with django, channels, celery and redis.

Django Channels Websocket Chatbot A Django chatbot that is capable of doing math and searching Chinese poet online. Developed with django, channels, c

Yunbo Shi 8 Oct 28, 2022
A handy tool for generating Django-based backend projects without coding. On the other hand, it is a code generator of the Django framework.

Django Sage Painless The django-sage-painless is a valuable package based on Django Web Framework & Django Rest Framework for high-level and rapid web

sageteam 51 Sep 15, 2022
A beginner django project and also my first Django project which involves shortening of a longer URL into a short one using a unique id.

Django-URL-Shortener A beginner django project and also my first Django project which involves shortening of a longer URL into a short one using a uni

Rohini Rao 3 Aug 8, 2021
Dockerizing Django with Postgres, Gunicorn, Nginx and Certbot. A fully Django starter project.

Dockerizing Django with Postgres, Gunicorn, Nginx and Certbot ?? Features A Django stater project with fully basic requirements for a production-ready

null 8 Jun 27, 2022
pytest-django allows you to test your Django project/applications with the pytest testing tool.

pytest-django allows you to test your Django project/applications with the pytest testing tool.

pytest-dev 1.1k Dec 14, 2022
APIs for a Chat app. Written with Django Rest framework and Django channels.

ChatAPI APIs for a Chat app. Written with Django Rest framework and Django channels. The documentation for the http end points can be found here This

Victor Aderibigbe 18 Sep 9, 2022
django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project. Inspired in the dashboard framework Dashing

django-dashing django-dashing is a customisable, modular dashboard application framework for Django to visualize interesting data about your project.

talPor Solutions 703 Dec 22, 2022
Django-MySQL extends Django's built-in MySQL and MariaDB support their specific features not available on other databases.

Django-MySQL The dolphin-pony - proof that cute + cute = double cute. Django-MySQL extends Django's built-in MySQL and MariaDB support their specific

Adam Johnson 504 Jan 4, 2023
Django-Audiofield is a simple app that allows Audio files upload, management and conversion to different audio format (mp3, wav & ogg), which also makes it easy to play audio files into your Django application.

Django-Audiofield Description: Django Audio Management Tools Maintainer: Areski Contributors: list of contributors Django-Audiofield is a simple app t

Areski Belaid 167 Nov 10, 2022
django Filer is a file management application for django that makes handling of files and images a breeze.

django Filer is a file management application for django that makes handling of files and images a breeze.

django CMS Association 1.6k Jan 6, 2023
Twitter Bootstrap for Django Form - A simple Django template tag to work with Bootstrap

Twitter Bootstrap for Django Form - A simple Django template tag to work with Bootstrap

tzangms 557 Oct 19, 2022