6.1 Introduction

Hyperlinks, casually called links, are the key feature of the web. The ability to click on text or an image to navigate to a new webpage is a basic necessity for any website. Without this functionality, you would have to enter a URL for each and every webpage you wished to view.

For the most part, our website does not make use of links. We have skeleton links: HTML anchor <a> tags without the href attribute defined (the exception being the links in the Newslink model, but these links point to external sources, not our own webpages).

Building a link in HTML is trivial. To create a link to our tag list webpage, we could simply code <a href="/tag/">. However, maintaining the Don’t Repeat Yourself (DRY) principle in Django while ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.