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 6875585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:20:58+00:00 2026-05-27T04:20:58+00:00

I have a question: how to get the current path of the url. Let’s

  • 0

I have a question: how to get the current path of the url. Let’s say, I have 3 navigation bars, about , blog and contact page. In each page, I have facebook, twitter and a manual email a friend button. When I clicked the email a friend button, and the current URL is http://www.example.com/about, the current URL is now already http://www.example.com/emailafriend. How can I get the http://www.example/about? Also in blog and contact. Please help me. Thanks.

  • 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-27T04:20:59+00:00Added an answer on May 27, 2026 at 4:20 am

    How does your email a friend button work? Is it a django view that takes the current URL and emails it? If so, you don’t want the “current” URL, which, as you note, is actually the email a friend URL. What you want to do is pass the URL you want to share as a URL parameter, ie:

    /share?url=http://www.example.com/blog

    Adding more info based on comments:

    When I was referencing URL above, I was not referring to your django URL configuration. Let’s take a step back.

    On your About page you have a link to email a friend, right? That link is probably generated in your template, but it’s the same on every page. Something like:

    <a href="/emailafriend">Email a friend</a>
    

    Instead of this, try this:

    <a href="/emailafriend?url={{ request.get_full_path }}">Email a friend</a>
    

    Now you need to make your email_a_friend view handle this. It can get the url via

    request.get('url', '').
    

    Some additional information:

    You might want to escape the {{ request.get_full_path }} function so that it’s escaped and URL safe, then you’ll have to unescape it in your view. Once you get the URL back to your view, you can do as you please with it.

    {{ request.get_full_path|urlencode }}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question about JSF and GET http request. How can I get
I have a question about the JFileChooser in Swing. I'm trying to get multiple
So, i have some question about xml Documents in Java. Can i get all
I just have a quick question about how to get the length of a
I have a question regarding how to get a div height. I'm aware of
I have a Question class: class Question { public int QuestionNumber { get; set;
I have few Question for which I am not able to get a proper
I have a question. How could I get the data from a google search
I have this question relating to Lucene. I have a form and I get
I have a question concerning Core Data and how, if at all, Entities get

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.