title: Passing parameters to login_redirect_url
body: <p>I'd like my login page to redirect a user to an instance of a page. Such an instance will be denoted as follows:</p>
  
  <blockquote>
    <blockquote>
      <p>www.example.com/adminpage/username</p>
    </blockquote>
  </blockquote>
  
  <p>This is what I have in my <strong>settings.py</strong></p>
  
  <pre><code>LOGIN_REDIRECT_URL = 'leicunnadmin'
  LOGOUT_REDIRECT_URL = 'login'
  </code></pre>
  
  <p>In the <strong>urls.py</strong>:</p>
  
  <pre><code>urlpatterns = [
      path('', views.index, name='index'),
  
      path('leicunnadmin/&lt;str:user&gt;', views.leicunnAdmin, name='leicunnadmin'),
  ]
  </code></pre>
  
  <p>The following is the code from the <strong>views.py</strong> script. My aim here was to check that the <strong>user</strong> is <strong>authenticated</strong>, get their <strong>username</strong> and append that to the URL. (The code)</p>
  
  <pre><code>@login_required
  def leicunnAdmin(request, user):
      username = None
      User = get_user_model()
      if request.user.is_authenticated:
          username = request.user.username
          get_logged_user = User.objects.get(username=user)
          print('get_logged_user: '+username)
          return render(request, 'leicunnadmin.html')
      else:
          return render(request, 'login')
  </code></pre>
  
  <p>Instead what I get when I log in is <strong>www.example.com/adminpage</strong>. When I type in the logged in username (www.example.com/adminpage/<strong>manuallytypedusername</strong>), it then redirects to the right page. Is there no way to automate this?</p>