Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6163399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:49:06+00:00 2026-05-23T21:49:06+00:00

I have a django template page, and want a link from this page, containing

  • 0

I have a django template page, and want a link from this page, containing current URL, for example, I am on /article/11 and want link to /article/11/remove
I tried the following construction:

<a href="{{ request.path }}remove">Remove article</a>

But I get link to /article/remove instead of /article/11/remove
However when I change it to

<a href="{{ request.path }}">

I get link to /article/11

How can I get URL not trimmed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:49:07+00:00Added an answer on May 23, 2026 at 9:49 pm

    I don’t see why it doesn’t point you to /article/11remove, which is what it sounds like it should do, but either way, you’re missing a slash. Try <a href="{{ request.path }}/remove"> instead.

    However, that’s really not the right way to do it. You shouldbe using {% url ‘name_of_remove_view’ %} to get the url, not assuming it’s going to be wherever you are plus /remove.

    Edit: In that case, your problem is probably that {{ request.path }} is not outputting anything at all. That would explain why just having “remove” would take you to /article/remove, and having “” would take you to where you currently are, due to the way that relative URLs work. You might want to make sure that you have a request object at all in your template environment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Django template that I want to extend in multiple places. In
Does Django have any template tags to generate common HTML markup? For example, I
In a Django template, how could I refer to the URL. I want to
I have an HTML django template page that is both RTL and LTR (depends
I want to take the URL from request.path in a template and do a
I have a search field at the top of my django template (with no
I have a basic question, in the Django template language how can you tell
I have some french letters (é, è, à...) in a django template but when
I have a problem using the '|default' in django templates. If I do this
I am new to the Django web framework. I have a template that displays

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.