Skip to Content
Django 3 Web Development Cookbook - Fourth Edition
book

Django 3 Web Development Cookbook - Fourth Edition

by Aidas Bendoraitis, Jake Kronika
March 2020
Intermediate to advanced
608 pages
17h 17m
English
Packt Publishing
Content preview from Django 3 Web Development Cookbook - Fourth Edition

Getting ready

Start by creating the music app from the Importing data from a local CSV file and Preparing paginated sitemaps for search engines recipes. Specifically, follow the steps in the Getting ready section to set up the models, forms, views, URL configurations, and templates.

To the view listing songs, we will add filtering by artist that later will be used by the RSS feed too:

  1. Add a filter form to forms.py. It will have the artist choice field with all artist names sorted alphabetically with letter case ignored:
# myproject/apps/music/forms.pyfrom django import formsfrom django.utils.translation import ugettext_lazy as _from .models import Song# …class SongFilterForm(forms.Form):    def __init__(self, *args, **kwargs):        super().__init__ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Django 2 Web Development Cookbook - Third Edition

Django 2 Web Development Cookbook - Third Edition

Jake Kronika, Aidas Bendoraitis

Publisher Resources

ISBN: 9781838987428Supplemental Content