title: Django view returning POST instead of GET request
body: <p>So I have these working views for registration and login using POST requests, both of which returning profile.html.</p>
  <p>The problem is the login and registration views return a POST to the login or register urls when i submit the forms(according to cmd), to run the necessary functions.
  which means it is simply <strong>rendering the profile.html, but not running ITS view function.</strong></p>
  <p>How do i have the form submissions <strong>send a GET to the profile view while still having them send POST for their own respective functions</strong>.</p>
  <p><strong>Views:</strong></p>
  <pre><code>def log_in(request):
      if request.method == 'POST':
          form = log_form(request.POST)
          if form.is_valid():
              username = form.cleaned_data['username']
              password = form.cleaned_data['password']
              user = authenticate(request, username=username, password=password)
              if user is not None:
                  print(&quot;user exists&quot;)
                  login(request, user)
                  return render(request, 'profile.html')
              else:
                  print(&quot;user does not exist&quot;)
                  print(form.errors)
                  return render(request, 'login.html', {
                      'form2': log_form
                  })
          else:
              return render(request, 'login.html', {
              'form2': log_form
              })
      else:
          return render(request, 'login.html', {
              'form2': log_form
          })
  
  
  def profile(request, username): 
      if request.method == 'GET':
          user = Users.objects.get(username=username)
          interests = []
          interest_list = Interests.objects.filter(member=user)#i got 5 objs here
          for i in interest_list:
              interests.append(i.item)
              print('added interest')
          info = Bios.objects.get(author=user)
          return render(request, 'profile.html', {
              'user': user,
              &quot;interests&quot;: interests,
              'info': info
          })
  </code></pre>
  <p><strong>Urls:</strong></p>
  <pre><code>urlpatterns = [
      path('reg/', views.register, name='register'),
      path('log/', views.log_in, name='login'),
      path('profile/&lt;str:username&gt;/', views.profile, name='profile'),
      path('feed/', views.feed, name='feed')
  
  ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  </code></pre>
  <p><strong>login form:</strong></p>
  <pre><code>&lt;form method='POST' action=&quot;{%url 'login' %}&quot;&gt;
                          {% csrf_token %}
                          &lt;p&gt;Username: {{form2.username}}&lt;/p&gt;
                          &lt;p&gt;Password: {{form2.password}}&lt;/p&gt;
                          {{form2.errors}}
                          &lt;input type=&quot;submit&quot; value=&quot;submit&quot;&gt;
                          &lt;p style='margin-top: 10px;'&gt;Don't have an account?&lt;a href=&quot;{% url 'register' %}&quot;&gt; Register&lt;/a&gt;&lt;/p&gt;
                      &lt;/form&gt;
  </code></pre>
  <p><strong>register form:</strong></p>
  <pre><code>&lt;form method='POST' action=&quot;{% url 'register' %}&quot;&gt;
                          {% csrf_token %}
                          &lt;p&gt;Username: {{form.username}}&lt;/p&gt;
                          &lt;p&gt;Email:    {{form.email}}&lt;/p&gt;
                          &lt;p&gt;Password: {{form.password}}&lt;/p&gt;
                          &lt;p&gt;Phone:    {{form.phone}}&lt;/p&gt;
                          &lt;p&gt;First name:   {{form.first_name}}&lt;/p&gt;
                          &lt;p&gt;Last name:    {{form.last_name}}&lt;/p&gt;
                          {{form.errors}}
                          {% if form.errors %}
                              {% for field in form %}
                                  {% for error in field.errors %}
                                      &lt;p&gt;
                                          &lt;strong&gt;{{ error|escape }}&lt;/strong&gt;
                                      &lt;/p&gt;
                                  {% endfor %}
                              {% endfor %}
                              {% for error in form.non_field_errors %}
                                  &lt;p&gt;
                                      &lt;strong&gt;{{ error|escape }}&lt;/strong&gt;
                                  &lt;/div&gt;
                              {% endfor %}
                          {% endif %}
                          &lt;input type='submit' value='Submit'&gt;
                          &lt;p style=&quot;margin-top: 5px;&quot;&gt;Already have an account?&lt;a href=&quot;{% url 'login' %}&quot;&gt; Log In&lt;/a&gt;&lt;/p&gt;
                      &lt;/form&gt;
  </code></pre>