[Answered ]-Django โ€“ separate authentication backend code from implementation

2๐Ÿ‘

โœ…

I suggest writing an abstract base class that encapsulates the expected functionality. This acts somewhat like an interface does in programming languages like C# and Java. Then have a django setting that specifies the class to be used for the get_user_by_username provider.

This means that future developers can put their get_user_by_username implementation anywhere they see fit as long as it is implemented in a class derived from the abstract base class and they point to it in settings.

๐Ÿ‘คPrydie

Leave a comment