title: how can I add a url for my template in django python?
body: <p>i use a <strong>template</strong> im my django homepage.(<a href="http://127.0.0.1:8000/" rel="nofollow noreferrer">http://127.0.0.1:8000/</a>)<br />
  I linked statics files in static folder and formed like {% static .....}<br />
  when i path it in urls in the main page it work correctly.<br />
  but when I give it an slug like 'p/' it doesn't work.<br />
  because it search for statics in p folder:
  &quot;GET /p/static/post/js/scripts.js HTTP/1.1&quot; 404 2598&quot;<br />
  my app name is &quot;post&quot; .
  please help?&quot;</p>
  <pre><code>&lt;link href=&quot;{% static 'post/css/bootstrap.css' %}&quot; rel=&quot;stylesheet&quot;&gt;
  &lt;link href=&quot;{% static 'post/css/fontawesome-all.css' %}&quot; rel=&quot;stylesheet&quot;&gt;
  &lt;link href=&quot;{% static 'post/css/swiper.css' %}&quot; rel=&quot;stylesheet&quot;&gt;
  &lt;link href=&quot;{% static 'post/css/magnific-popup.css' %}&quot; rel=&quot;stylesheet&quot;&gt;
  &lt;link href=&quot;{% static 'post/css/styles.css'%}&quot; rel=&quot;stylesheet&quot;&gt;             
  '
  </code></pre>
  <p>this my setting:<br />
  <code>STATIC_URL = '/static/   MEDIA_URL = '/media/' STATIC_ROOT = os.path.join(BASE_DIR, &quot;static&quot;)   MEDIA_ROOT = os.path.join(BASE_DIR, 'media') </code></p>
  <p>this my urls.py:</p>
  <pre><code>urlpatterns = [
  path('admin/', admin.site.urls),
  path('',include('post.urls')),]'
  urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
  
  
  if settings.DEBUG:
  urlpatterns += [
      re_path(r'^media/(?P&lt;path&gt;.*)$', serve, {
          'document_root': settings.MEDIA_ROOT,
      }),
  ]
  </code></pre>
  <p>this is my views:<br />
  '''</p>
  <pre><code>from django.shortcuts import render  
  from django.http import HttpResponse  
  from .models import app_post  
  def hello(request):
  html = &quot;&lt;h&gt;salam django&lt;h&gt;&quot;
  return HttpResponse(html)  
  def page(request):
  return render(request,'post/index.html')
  </code></pre>
  <p>'''
  this is my app urls:</p>
  <pre><code>urlpatterns = [
  path('',page,name = 'page'),
  path('h/',hello,name = 'hello'),
  ]
  </code></pre>