title: How to check if request.GET or request.POST is from a particular part of a URL?
body: <p><strong>Technologies:</strong> Django 1.7.7, Python 3</p>
  
  <pre><code>currentUrl = request.get_full_path()
  if request.method == 'POST' and request.POST('/path/to/thing', currentUrl):
      # Do something
  </code></pre>
  
  <p>I'm trying to check if the request method is a POST and if the request is coming from a particular URL, but not including the users input as as part of the url (if that makes sense).</p>
  
  <p>So, for example, let's say a user is filling out a form and he/she submits the word "hello." I want to check to see if the form is from "some/base/url" without checking to see if the word "hello" is in the url too.</p>
  
  <p>What is the best way to accomplish this?</p>
  
  <p>Found this to work:</p>
  
  <pre><code>  if request.method == 'GET' and '/path/to/thing' in request.path_info
  </code></pre>