Disable admin login

Is there eazy way disabled django admin login temporarily?(without middlware)

If you are asking if there is a way that is built into Django that you can leverage without making any changes, no.

However, you can do any number of things to do this - probably the simplest is to comment out the admin url definition.

Can you say what they are?

It wouldn’t work, because I want to use admin site. Only need to disable the login barrier.

To answer your question then, no. The Django admin requires an authenticated user in order to use it. Something needs to establish a User object associated with the requests.

So, only solution would be a custom middlware setting an auth user automatically for every request? Or other method?

You could set up your web server to use the REMOTE_USER authentication scheme. That would avoid needing to use any “custom” middleware.

What & how should I do that?

Sorry, I thought I copied the link: How to authenticate using REMOTE_USER | Django documentation | Django

1 Like

:+1: It still uses middlware, but it’s batter than custom middlware. Thank you.