title: Putting a Django app under a path on a webserver
body: <p>I am developing a Django app, and testing it on http://localhost:8000 on the development server.</p>
  <p>My urls file has urls in the sorts of:</p>
  <pre><code>path('somepath1/', myviewclass.function1, name='view_name1'),
  path('somepath2/', myviewclass.function2, name='view_name2'),
  </code></pre>
  <p>etc...</p>
  <p>I have some static links to views in some of the templates using</p>
  <pre><code>{% url 'view_name1' %} 
  </code></pre>
  <p>When I navigate the app, as I click links the paths work correctly :
  If I goto http://localhost:8000/somepath1/, and then click on a link to another view I get the url : http://localhost:8000/somepath2/</p>
  <p>When I put the app on the webserver under the url : <a href="http://myserver.com/myapp" rel="nofollow noreferrer">http://myserver.com/myapp</a>, as I click the links and submit forms the paths start accumulating.</p>
  <p>If I goto <a href="http://myserver.com/myapp/somepath1/" rel="nofollow noreferrer">http://myserver.com/myapp/somepath1/</a>, and the click on a link to another view I get the url : <a href="http://myserver.com/myapp/somepath1/somepath2/" rel="nofollow noreferrer">http://myserver.com/myapp/somepath1/somepath2/</a>, and that is not matched in the urls so I get a 404.</p>
  <p>How do I prevent this ?
  Thanks
  Regards</p>