Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Django 1.0 Template Development
  • Table Of Contents Toc
Django 1.0 Template Development

Django 1.0 Template Development

By : Scott Newman
4 (2)
close
close
Django 1.0 Template Development

Django 1.0 Template Development

4 (2)
By: Scott Newman

Overview of this book

This book is designed for readers who learn by doing and employs many examples and screenshots to let the reader dig in and start coding. This book isn't designed to be a reference; instead it has a practical, example-driven approach that teaches you by following along with the examples in the chapters. When you have completed this book, you will fully understand how the template system works, how to extend it when you have specialized needs, and how to optimize the performance and usability of your content. This book is for web developers and template authors who want to fully understand and utilize the Django template system. The reader should have completed the introductory tutorials on the Django project's website and some experience with the framework will be very helpful. Basic knowledge of Python and HTML is assumed.
Table of Contents (17 chapters)
close
close
Django 1.0 Template Development
Credits
About the Author
About the Reviewers
Preface
1
Index

Customizing the admin header


To make our admin site feel less generic, we'll replace the default title and header at the top of the pages.

Create a new directory called admin under the directory mycompany/templates. Copy the django/contrib/admin/templates/base_site.html file to your templates/admin directory. This is the first file we'll be overriding.

Replacing the page title

In our admin pages, the page title is presented in this format:

<title>Site administration | Django site admin</title>

This can be changed by editing the title block in base_site.html. Open the mycompany/templates/admin/site_base.html file and edit the block that looks like this:

{% block title %}{{ title }} | {% trans 'Django site admin' %}{% endblock %}

Replace the text in quotes after the pipe symbol with our site's title:

{% block title %}{{ title }} | {% trans 'MyCompany Administration' %}{% endblock %}

Note

The trans tag is used by Django's internationalization (i18n) libraries to translate text into other...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Django 1.0 Template Development
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon