title: Ref doesn't work correctly with my settings
body: <p>I'm learning to make some chat website, and i cannot quite get how to use urls correctly. The problem is that when I get to &quot;http://127.0.0.1:8000/chat&quot;, links into the header became like &quot;http://127.0.0.1:8000/chat/main&quot; instead of &quot;http://127.0.0.1:8000/main&quot;</p>
  <p>project urls:</p>
  <pre><code>from django.contrib import admin
  from django.urls import path
  from django.urls import include, path
  from chat import views as chat_views
  from mainapp import views as mainapp_views
  
  urlpatterns = [
      path('admin/', admin.site.urls),
      path('', mainapp_views.index),
      path('chat/', include('chat.urls')),
  
  ]
  </code></pre>
  <p>chat app urls:</p>
  <pre><code>from django.urls import path
  
  from . import views
  
  urlpatterns = [
      path('', views.index, name='index'),
      path('&lt;str:room_name&gt;/', views.room, name='room'),
  
  ]
  </code></pre>
  <p>chat app views:</p>
  <pre><code>from django.shortcuts import render
  
  def index(request):
      return render(request, 'chat/chatindex.html')
  
  def room(request, room_name):
      return render(request, 'chat/room.html', {
          'room_name': room_name
      })
  </code></pre>
  <p>index.html</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  {% load static %}
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;utf-8&quot;/&gt;
      &lt;link rel=&quot;stylesheet&quot; href=&quot;{% static 'css/bootstrap.css' %}&quot;/&gt;
      &lt;title&gt;{% block title %}{% endblock title %}&lt;/title&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;header&gt;
      &lt;div class=&quot;navbar navbar-dark bg-dark shadow-sm&quot;&gt;
          &lt;a href=&quot;&quot; class=&quot;navbar-brand d-flex align-items-center&quot;&gt;Главная&lt;/a&gt;
          &lt;a href=&quot;searching&quot; class=&quot;navbar-brand d-flex align-items-center&quot;&gt;Поиск собеседников&lt;/a&gt;
          &lt;a href=&quot;contacts&quot; class=&quot;navbar-brand d-flex align-items-center&quot;&gt;Контакты&lt;/a&gt;
          &lt;a href=&quot;faq&quot; class=&quot;navbar-brand d-flex align-items-center&quot;&gt;FAQ&lt;/a&gt;
          &lt;a href=&quot;login&quot; class=&quot;navbar-brand d-flex align-items-center&quot;&gt;Регистрация/Вход&lt;/a&gt;
      &lt;/div&gt;
      &lt;/div&gt;
  &lt;/header&gt;
  &lt;main&gt;
  &lt;div&gt;{% block content%}{% endblock content %}&lt;/div&gt;
  &lt;/main&gt;
  &lt;footer class=&quot;footer mt-auto py-3 bg-light&quot;&gt;
    &lt;div class=&quot;container&quot;&gt;
      &lt;span class=&quot;text-muted&quot;&gt;Давай общаться!&lt;/span&gt;
    &lt;/div&gt;
  &lt;/footer&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>chatindex.html</p>
  <pre><code>{% extends &quot;index.html&quot; %}
  {% block title %}Контакты{% endblock title %}
  {% block header %}{% endblock header %}
  {% block content %}
  В какую комнату хотите зайти?
  &lt;br&gt;
  &lt;input id=&quot;room-name-input&quot; type=&quot;text&quot; size=&quot;100&quot;&gt;
  &lt;br&gt;
  &lt;input id=&quot;room-name-submit&quot; type=&quot;button&quot; value=&quot;Enter&quot;&gt;
  
  &lt;script&gt;
          document.querySelector('#room-name-input').focus();
          document.querySelector('#room-name-input').onkeyup = function(e) {
              if (e.keyCode === 13) {  // enter, return
                  document.querySelector('#room-name-submit').click();
              }
          };
  
          document.querySelector('#room-name-submit').onclick = function(e) {
              var roomName = document.querySelector('#room-name-input').value;
              window.location.pathname = '/chat/' + roomName + '/';
          };
  
  
  
  &lt;/script&gt;
  
  {% endblock content%}   
  </code></pre>
  <p>I'm pretty sure that the problem is about &quot;<code>path('&lt;str:room_name&gt;/', views.room, name='room')</code>&quot;, but i can't understand how to fix it and save opportunity to enter rooms with chat-page.
  Thanks a lot!</p>