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

  • SEARCH
  • Home
  • 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 421071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:56:50+00:00 2026-05-12T18:56:50+00:00

In django, when a URL is matched, the match group is passed as a

  • 0

In django, when a URL is matched, the match group is passed as a second parameter to the view function, the first being a HttpRequest object. For example, with a URL patter like this

'/foo/(\d{2})/', 'app.views.handler'

the handler routine will have

def handler(request, value):

where value will contain a two digit number (as a string).

My question is: is value also contained in the request object, and if yes, how can I get it (of course, parsing the URL from the request object is not an option, too impractical).

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-12T18:56:51+00:00Added an answer on May 12, 2026 at 6:56 pm

    I’m not going to debate the merit of your idea. Just try to answer your question:

    No there is no way, other than applying the regex to the URL again, to get at the url parameter.

    Your view will be the first point where the parameter list will be available. Why don’t you just create a wrapper object to encapsulate your request and your parameter list at that point?

    Just pass that around…

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

Sidebar

Related Questions

Let's say I want the following url to get matched with a django view
I have a simple Django view that just returns URL parameters, but if I
background: url({{ MEDIA_URL }}/bg.jpg); That does not work, because this Django template function only
Is there a way to get the complete django url configuration? For example Django's
I'm using django's url tag to move from one view to another: <a href
Django url pattern that have a number parameter is: url(r'^polls/(?P<poll_id>\d+)/$', 'polls.views.detail') What will be
In my Django application, I have a URL I would like to match which
I'm trying to match a Django URL bit that can contain: _ , %
In Django URL patterns, what's the proper way to take this URL: http://example/i/fb/#access_token=12345678910|b1827b912847b81938747b91849-193867192305817|EKWOGJhcinWIjWij8174-NgjRojb&expires_in=0 And
I had a quick question about Django URL configuration, and I guess REGEX as

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.