Heads up! To view this whole video, sign in with your Courses Plus account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Let's add a view to our app to show a list of all of our courses.
include()
allows you to include a list of URLs from another module. It will accept the variable name or a string with a dotted path to the default urlpatterns
variable.
If you don't have include()
in your urls.py
(more recent versions of Django have removed it), add it to the import
line that imports url
. That line will now look like from django.conf.urls import url, include
.
This is the Comprehensions Workshop that's mentioned in the video. Comprehensions are a great way of doing quick work with iterables.
You need to sign up for Treehouse in order to download course files.
Sign up