O'Reilly logo

Django Unleashed by Andrew Pinkham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5.5 Generating 404 Errors for Invalid Queries

As things stand, we can use the command line to start our development server (Example 5.11) and see the fruits of our labor.

Example 5.11: Shell Code

$ ./manage.py runserver

If you navigate to the address of a valid Tag, you will be greeted by a simple HTML page built from our template. For example, http://127.0.0.1:8000/tag/django/ will display a simple page about our Django tag. However, what happens if you browse to a URL built with an invalid tag slug, such as http://127.0.0.1:8000/tag/nonexistent/?

You’ll be greeted by a page of Django debug information, as shown in Figure 5.4.

Image

Figure 5.4: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required