6. Styling Django Web Pages

Let’s say you have this perfectly ordinary style sheet style.css:

image

This style sheet styles <body> text in Web pages red, <h1> headers blue, and <p> elements green (perhaps not the most pleasing color scheme). How do you apply this style sheet to a Django Web page with <body> text, <h1> headers, and <p> elements?

Many Web servers will serve your style sheet in addition to your Django application, but some (like the development server we’ve been using) will not, because they leave the delivery of Django content up to Django. To make sure that your style sheets are served to your Django application no matter what Django-enabled ...

Get Django: Visual QuickPro Guide 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.