In this lesson, you’re going to create your views and have a visit with your good friend, the AttributeError
! According to this error message, the module project.views
has no attribute called all_projects
, so head over to views.py
to create this view:
# Create your views here.
def all_projects(request):
return render(request, 'all_projects.html')
Now, you’re getting a new error message, TemplateDoesNotExist
, because you haven’t yet created this template, so Django doesn’t know what to render.
reblark on Feb. 25, 2020
Your top level structure is Project>portfolio,projects, yes? In the views directory you import Poject from projects.models, yes?
If my structure is Gulls>pix,pixie, shouldn’t I (in “views”) import Gulls from pixie.models? forsta?