Skip to content

Instantly share code, notes, and snippets.

@AlwxSin
Created March 21, 2017 07:08
Show Gist options
  • Save AlwxSin/39bc048d3da1c26030d91fce20df81d3 to your computer and use it in GitHub Desktop.
Save AlwxSin/39bc048d3da1c26030d91fce20df81d3 to your computer and use it in GitHub Desktop.
django type hinting classes
class AuthMiddlewareAwareHttpRequest(django.http.HttpRequest):
if 'django.contrib.auth' in django.conf.settings.MIDDLEWARE:
user: django.contrib.auth.models.AbstractUser
def myview(request: AuthMiddlewareAwareHttpRequest):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment