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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:16:14+00:00 2026-05-23T08:16:14+00:00

How is this possible to make overloaded views in Django ? The problem is

  • 0

How is this possible to make overloaded views in Django ?
The problem is I have a view which may accept exactly one argument or none.
If there is a argument, it will pass it to view.

Let show what I am tryin’ to do

views.py

def member_list(request,message):
    memberList = Member.objects.all()
    return render_response(request, 'user/member_list.html', {'memberList': memberList,    'message':message })

def member_list(request,message):
    memberList = Member.objects.all()
    return render_response(request, 'user/member_list.html', {'memberList': memberList,    'message':message })

urls.py

(r'^member/list/$', 'views.member_list'),
(r'^member/list/(?P<message>[-\w]+)/$', 'views.member_list'),

What is the right way to do this ?

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-23T08:16:15+00:00Added an answer on May 23, 2026 at 8:16 am
    def member_list(request,message=None):
        if message:
            pass
        else:
            pass
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a variable length array in Javascript. Is this possible. A
Is it possible to make a progressbar in Java like displayed on this page?
i'm wondering about this possibility. Is it possible to make our code written in
I'm calling a SSIS package using LoadPackage(...). Is it possible to make this call
$(#tab1).click(function(){ loadTab(1); $('div.HOMEtabdiv ul.HOMEtabs a').removeClass('selected'); $(this).addClass('selected'); }); Would it be possible to make the
I want to make this specialized w/o changing main. Is it possible to specialize
I'll try to make this as straight forward as possible. Currently our team has
Is this possible? I want to have the To:, Body, and an Attachment all
Is this possible? I am looking forward to a tutorial which explains the steps
In Java is there anyway to have one constructor that will accept an array

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.