I think that Django's magic isn't statically typecheckable, so I tend to avoid those features altogether. If it's not possible, you can still provide a custom stubs for your needs, or provide a custom abstraction that wraps the not-typechecked parts, or accept that some parts of your codebase are less safe to modify than others. Nothing perfect, but it works.