title: How to redirect to an explicitly named url in Django?
body: <p>I am trying to have a redirect to a specific page base on a variable in my views.py:</p>
  
  <pre><code>redirect(f'feed/user/{first_user}')
  </code></pre>
  
  <p>But by having it like this it redirects me to the url:</p>
  
  <pre><code>feed/search/feed/user/first_user
  </code></pre>
  
  <p>instead I would like to redirect to the url</p>
  
  <pre><code>feed/user/first_user
  </code></pre>
  
  <p>I know that the <code>feed/search/</code> part is appended because the <code>search</code> url in my urls.py calls the function that should redirect but I would like to keep it that way and only change the redirect.</p>
  
  <p>URLS.PY:</p>
  
  <pre><code>urlpatterns = [
      path('', login_required(PostListView.as_view()), name='feed-home'),
      path('user/&lt;str:username&gt;/', login_required(UserPostListView.as_view()), name='user-feed'),
      path('post/&lt;int:pk&gt;/', login_required(views.post_detail), name='post-detail'),
      path('comment_delete/', login_required(views.comment_delete), name='comment-delete'),
      path('post/new/', login_required(PostCreateView.as_view()), name='post-create'),
      path('post/&lt;int:pk&gt;/update', login_required(PostUpdateView.as_view()), name='post-update'),
      path('post/&lt;int:pk&gt;/delete', login_required(PostDeleteView.as_view()), name='post-delete'),
      path('about/', views.about, name='feed-about'),
      path('like/', login_required(views.post_like), name="post-likes"),
      path('comment_create/', login_required(views.comment_create), name="comment-create"),
      path('search/', login_required(views.user_search), name="user-search"),
  ]
  </code></pre>