Django redirect after logout
<p>I'm using Django and to authenticate my user, I have a custom OAuth2 provider. I had to write the login and logout view myself because they are doing some very specific things.</p>

<p>I would like to be redirected to the same url after logout. If you are on a page that require to be authenticated, I would like to redirect to the homepage. I didn't find any resource to know if a view/endpoint is using the decorator <code>login_required</code> </p>

<p>The <a href="https://docs.djangoproject.com/en/1.10/topics/auth/default/#the-login-required-decorator" rel="nofollow"><code>login_required</code></a> decorator takes a parameter to redirect users. You could use this.</p>

<p>As of Django 1.9, you could also use the <a href="https://docs.djangoproject.com/en/1.10/topics/auth/default/#redirecting-unauthorized-requests-in-class-based-views" rel="nofollow"><code>AccessMixin</code></a>. </p>

<p>Unless I misunderstand your question, all the information you need is in the docs. Are you using an older version of Django?</p>

python django