O'Reilly logo

The Definitive Guide to Django: Web Development Done Right, Second Edition by Jacob Kaplan-Moss, Adrian Holovaty

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

Chapter 3. Views and URLconfs

In the previous chapter, we explained how to set up a Django project and run the Django development server. In this chapter, you'll learn the basics of creating dynamic Web pages with Django.

Your First Django-Powered Page: Hello World

As a first goal, let's create a Web page that outputs that famous example message: "Hello world."

If you were publishing a simple "Hello world" Web page without a Web framework, you'd simply type "Hello world" into a text file, call it hello.html, and upload it to a directory on a Web server somewhere. Notice that you specified two key pieces of information about that Web page: its contents (the string "Hello world") and its URL (http://www.example.com/hello.html, or maybe http://www.example.com/files/hello.html ...

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