Mรณdulo 09 ยท Django APIs & Auth โ Lecciรณn 2 de 3 ยท ~8 min
Auth in Django
A User model, already built
Every Flask or FastAPI project you'll ever write needs its own User table, its own password hashing, its own login endpoint. Django ships all of it: django.contrib.auth gives you a User model, createsuperuser, password hashing, and a login view โ nothing to design.
request.user is available on every view. Log in, and it's a User instance; not logged in, and it's an AnonymousUser. Either way, request.user.is_authenticated just works.