[Django]-Why does django need a database for custom authentication backends?

4👍

The reason why you specifically need to save the User object is that it’s common for apps to create database level relationships between objects and users (in order to persist the relationship across multiple requests).

A simple example would be the activity log in django.contrib.admin. It displays recent behaviour that users have performed. This only works when the user object is saved to the database.

2👍

Quite a few apps have a foreign key to auth.User; if you don’t have that table populated then you don’t get to use those apps.

Leave a comment