[Django]-Custom authentication with django?

15👍

Firstly, yes you should use Django’s authentication framework, and build your own custom auth backend.

Secondly, however you do it, you’ll need to have something in the views that you want to restrict access to. The best way to do that is via a decorator on the view. Again, Django’s built-in framework gives you access to the @login_required decorator, which does exactly what you want.

Leave a comment