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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:28:50+00:00 2026-05-26T07:28:50+00:00

(Context: I’m still very new to both Django and web development.) 1) Could someone

  • 0

(Context: I’m still very new to both Django and web development.)

1) Could someone explain the reasoning for the following statement? This Q/A answered the question of how to deal with it, but not why it might be a good/bad idea.

The docs state, “The page_not_found view should
suffice for 99% of Web applications, but if you want to override it,
you can specify handler404 in your URLconf”.

That is, the page_not_found view only passes on the requested URL and ignores
any message you provide when raising an exception. It seems to me that
having the option to provide helpful hints to the 404.html template
by default would be good for everyone.

2) I’m currently making a custom view so that I can pass on helpful messages for the following situation. Is there some reason I shouldn’t?

I’m using matrix URLs so the base resource is
a normal hierarchical URL followed by matrix options in the basic
format of:
;filter_type1=item:value,item:value;filter_type2=item:value…

So it is quite easy to provide helpful messages based on how far along
the parsing gets before having an error. It seems helpful to me to pass
on a message such as the following:

  • “Allowed filter_types are: type1, type2, type3.” or
  • “Allowed items for filter_type a are: item1, item2, item3.”

Apologies if I missed this explanation elsewhere. I’ve looked and I asked on google django-users but got no replies.

  • 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-26T07:28:50+00:00Added an answer on May 26, 2026 at 7:28 am

    I’m not really sure what the question is. The page_not_found view is basic by default because there aren’t that many situations where you need to explain why the page wasn’t found except that it wasn’t.

    I presume by ‘matrix options’ you mean URL/GET parameters like:

    http://domain.com/page/?option1=value&option2=value..
    

    Instead of throwing a 404 if they enter an incorrect combination of parameter, why not default to the base url/template (http://domain.com/page/) with an error message saying “Option1 can only be x,y,z”. This way they are presented with a familiar page and can retry their selection without having to navigate back from a 404 page (and it isn’t so confusing as to why it didn’t work).

    You can use django’s messaging framework to easily accomplish this (I’ve done so in the past). Pass an error message to the template when you are checking the parameters in the view.

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

Sidebar

Related Questions

Context PHP 5.3.x Overview After doing a code-review with an associate who uses both
Context: HTML widgets generated using a Django ModelForm and template, jQuery 1.3.2, JavaScript on
Context: .NET web service deployed on local IIS in XP. VS 2010 used to
Context.startService Intent intent = new Intent(context, MyService.class); context.startService(intent); PendingIntent.getService Intent intent = new Intent(context,
Context The case is screen scraping web content using QuotaXML SDK 1.6 to finally
Context I have a web game in JavaScript. I send scores and achievements with
Context: Web Application - Java, Spring MVC, Spring Security What is not transparent to
Context I want to display Twitter and Facebook buttons on my new site. But
Context: I'm in charge of running a service written in .NET. Proprietary application. It
Context: So, I am attempting to build a ridiculously complex domain model. Talking with

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.