title: Django will not reload page upon re-rendering of current page
body: <p>I'm working on a Django app and am authenticating users via a custom authentication. Authentication works great but when I return the rendering of the same page, Django just hangs. Essentially I have a POST request url <code>auth digits</code> and if success I return the rendering of the current page <code>jubi</code>. I've tried a HttpResponseRedirect and the server calls the GET request, but doesn't reload the page(maybe because it recognizes it is already on the page?).</p>
  
  
  
  <p>urls.py</p>
  
  <pre class="lang-py prettyprint-override"><code>urlpatterns = [
  url(r'^index/$', views.index, name='index'),
  url(r'^jubi/$', views.jubi, name='jubi'),
  url(r'^login/$', views.login, name='login'),
  url(r'^logout/$', views.logout, name='logout'),
  url(r'^auth_digits/$', views.auth_digits, name='auth_digits'),
  ]
  </code></pre>
  
  <p>views.py</p>
  
  <pre class="lang-py prettyprint-override"><code>def jubi(request):
      return render(request, 'frontend/jubi.html',
                      {'user': request.user}, context_instance=RequestContext(request))
  
  @csrf_exempt
  def auth_digits(request):
      apiUrl = request.POST.get('apiUrl', '')
      credentials = request.POST.get('credentials', '')
      dAuth = DigitsAuth()
      user = dAuth.authenticate(apiUrl=apiUrl, credentials=credentials)
  
      if user is not None:
          user.backend = 'django.contrib.auth.backends.ModelBackend'
          auth.login(request, user)
          return render(request, 'frontend/jubi.html',
                      {'user': request.user}, context_instance=RequestContext(request))
      else:
          return HttpResponseRedirect('invalid')
  </code></pre>
  
  <p>jubi.html</p>
  
  <pre class="lang-py prettyprint-override"><code>{% if user.is_authenticated %}
      &lt;script&gt;console.log("we are auth")&lt;/script&gt;
  {% else %}
      &lt;div class="load-login-form"&gt;&lt;/div&gt;                               
  {% endif %} 
  </code></pre>