title: Django 1.5 robots.txt
body: <p>Here is what we have in our url conf:</p>
  
  <pre><code>from django.views.generic import TemplateView
  </code></pre>
  
  <p>.....</p>
  
  <pre><code>url(r'^robots\.txt$', TemplateView.as_view(template_name='robots.html')),
  </code></pre>
  
  <p>For some reason, we're getting redirected to ?next=robots.txt when attempting to hit *.com/robots.txt</p>
  
  <p>Is there something obvious we're missing ? This seems to work locally in vagrant environments but it's not working in production (redirecting through ?next=) </p>
  
  <p>update 1
  There is no obvious reason that this would be behind a @login_required decorator or any required login function...</p>
  
  <p>update 2
  Sure enough, you can see robots.txt when you are authenticated....</p>
  
  <p>update 3 direct_to_template has been deprecated, I'm sure that used to work but apparently has been deprecated in django 1.5</p>
  
  <p>update 4 seems like this post has a way to force login_required for a TemplateView.as_view: <a href="https://stackoverflow.com/questions/2140550/how-to-require-login-for-django-generic-views">How to require login for Django Generic Views?</a> but it seems in our case this is being force by default ? </p>