title: Django, rendering a view from another view (call a specific URL)
body: <p>I have a little form:</p>
  <pre><code>&lt;form action=&quot;#&quot; method=&quot;post&quot;&gt;
      {% csrf_token %}
      &lt;label&gt;Company Number:&lt;/label&gt;
      &lt;input type=&quot;text&quot; name=&quot;company&quot; placeholder=&quot;&quot;/&gt;&lt;br&gt;
      &lt;input type=&quot;submit&quot; id=&quot;register value=&quot; OK&quot; /&gt;
  &lt;/form&gt;
  </code></pre>
  <p>Which is mapped like this:</p>
  <pre><code>url(r'^userfilt/insertForm/$', views.insertForm, name='insertForm'),
  </code></pre>
  <p>Now after submitting this form, I want to get back to the main view:</p>
  <pre><code>url(r'^userfilt/$', views.userfilt, name='userfilt')
  </code></pre>
  <p>URL mapping file:</p>
  <pre><code>app_name = 'SSO_Management_POC'
  urlpatterns = [
      url(r'^$', views.IndexView.as_view(), name='index'),
      url(r'^user/$', views.user, name='user'),
      url(r'^userfilt/$', views.userfilt, name='userfilt'),
      url(r'^userfilt/insertForm/$', views.insertForm, name='insertForm'),
      #url(r'^updateForm/$', views.updateForm, name='updateForm'),
      url(r'^(?P&lt;pk&gt;[0-9]+)/$', views.DetailView.as_view(), name='detail'),
      url(r'^(?P&lt;pk&gt;[0-9]+)/results/$', views.ResultsView.as_view(), name='results'),
      url(r'^(?P&lt;question_id&gt;[0-9]+)/vote/$', views.vote, name='vote'),
  ]
  </code></pre>
  <p>The main view is like this (but I don't think this code is related to the problem..):</p>
  <pre><code>def userfilt(request):
      if request.GET.get('create'):
          return HttpResponseRedirect('insertForm')
  
      if request.GET.get('update'):
          print request.GET.get('pk')
          return render(request, 'SSO_Management_POC/updateForm.html')
  
      if request.method == 'POST':
          form = UserForm(request.POST)
          val = request.POST.get('my_textarea')
          return render(request, 'SSO_Management_POC/userfilt.html',
                        {'top_user': TopUser.objects.filter(user_name__regex=val)})
      else:
          print '4'
          return render(request, 'SSO_Management_POC/userfilt.html')
  </code></pre>
  <p>Now the call that is killing me happens when N submit the form, N just wanna get back to the main page calling it with a POST, like a always did!</p>
  <pre><code>return render(request, &quot;SSO_Management_POC/userfilt.html&quot;)
  </code></pre>
  <p>I do it like this, but the problem is that the URL has not been reset.. and results in this,</p>
  <p><strong><a href="http://127.0.0.1:8000/SSO_Management_POC/userfilt/insertForm/#" rel="nofollow noreferrer">http://127.0.0.1:8000/SSO_Management_POC/userfilt/insertForm/#</a></strong></p>
  <p>Resulting in every operation I make on that page not work because it's not mapped anymore</p>
  <p>I mean, it should be:</p>
  <ul>
  <li><strong><a href="http://127.0.0.1:8000/SSO_Management_POC/userfilt/" rel="nofollow noreferrer">http://127.0.0.1:8000/SSO_Management_POC/userfilt/</a></strong></li>
  </ul>
  <p>but instead it is</p>
  <ul>
  <li><strong><a href="http://127.0.0.1:8000/SSO_Management_POC/userfilt/insertForm/#" rel="nofollow noreferrer">http://127.0.0.1:8000/SSO_Management_POC/userfilt/insertForm/#</a>)</strong></li>
  </ul>
  <p>To try to explain my issue better..</p>
  <p>I go to the main page (<a href="http://127.0.0.1:8000/SSO_Management_POC/userfilt/" rel="nofollow noreferrer">http://127.0.0.1:8000/SSO_Management_POC/userfilt/</a>)</p>
  <p><strong>&quot;GET /SSO_Management_POC/userfilt/ HTTP/1.1&quot; 200 2648</strong></p>
  <p>Then I click on the create User to call the form, it brings me to: (<a href="http://127.0.0.1:8000/SSO_Management_POC/userfilt/insertForm/" rel="nofollow noreferrer">http://127.0.0.1:8000/SSO_Management_POC/userfilt/insertForm/</a>)</p>
  <p><strong>&quot;GET /SSO_Management_POC/userfilt/insertForm/ HTTP/1.1&quot; 200 1549</strong></p>
  <p>Than I submit the form and I would like to get back to the main page, and here comes the thing I don't understand:
  it bring me here</p>
  <p><a href="http://127.0.0.1:8000/SSO_Management_POC/userfilt/insertForm/#" rel="nofollow noreferrer">http://127.0.0.1:8000/SSO_Management_POC/userfilt/insertForm/#</a></p>
  <p>But I want to go here</p>
  <p><a href="http://127.0.0.1:8000/SSO_Management_POC/userfilt" rel="nofollow noreferrer">http://127.0.0.1:8000/SSO_Management_POC/userfilt</a></p>
  <p>This is again the code:</p>
  <pre><code>return render(request, &quot;SSO_Management_POC/userfilt.html&quot;)
  </code></pre>
  <p>This is the call made:</p>
  <p><strong>&quot;POST /SSO_Management_POC/userfilt/insertForm/ HTTP/1.1&quot; 200 2648</strong></p>
  <p>I tried with render, with HttpResponseRedirect and so on... But always it happened the URL I'm calling with the previous one, I want it to be reset, I want it to be ../ !!!</p>
  <p>The only thing that work for me is:</p>
  <pre><code>return redirect(&quot;../&quot;)
  </code></pre>
  <p>but</p>
  <ol>
  <li>this is dirty</li>
  <li>this does not permit to make a POST call!</li>
  </ol>
  <p>Thanks to Daniel, I fixed it like this:</p>
  <pre><code>return redirect('/SSO_Management_POC/userfilt')
  </code></pre>
  <p>But it still give me same issue with:</p>
  <pre><code>return render(request,'/SSO_Management_POC/userfilt')
  </code></pre>
  <p>Getting me to <a href="http://127.0.0.1:8000/SSO_Management_POC/userfilt/insertForm/" rel="nofollow noreferrer">http://127.0.0.1:8000/SSO_Management_POC/userfilt/insertForm/</a></p>