1👍
✅
When you navigate to the URL for events.html
that invokes the events_index
view which loads the events
object into the template context via events = Events.objects.all()
. The core_index
view doesn’t include events
in the context, so there’s nothing for the loop to process. If you add an import for the Events model and events = Events.objects.all()
to core_index
things will work more like you expect.
Source:stackexchange.com