title: Django - usage of redirect_to_login
body: <p>I want to use <code>redirect_to_login</code> in my view. For some reason, I get redirected to login twice (and therefore the URL is malformed). </p>
  
  <p>My <code>TestView(View)</code> looks like this (relevant part):</p>
  
  <pre><code>def dispatch(self, request, *args, **kwargs):
      if not self.test_func():
          if self.redirect_to_login:
              return redirect_to_login(self.request.get_full_path())
          else:
              return HttpResponseForbidden()
  </code></pre>
  
  <p>My <code>urls.py</code> (relevant part):</p>
  
  <pre><code>url(r'^test/$', TestView.as_view()),
  </code></pre>
  
  <p>When I type <code>localhost:8000/test/</code> into my browser, I end up at </p>
  
  <p><code>http://localhost:8000/login/?next=/%3Fnext%3D/test/</code></p>
  
  <p>instead of expected</p>
  
  <p><code>http://localhost:8000/login/?next=/test/</code></p>
  
  <p>Any ideas what the problem might be? In case you need more files, just please ask.</p>