Welcome to the Treehouse Community
Looking to learn something new?
Kayla Johnson1,798 Points
super() takes at least 1 argument (0 given)
The video mentions using the following: def get_context_data(self, kwargs): context = super().get_context_data(kwargs)
But this doesn't work. I'm using Python 2.7 and I get the error that it needs an argument. What does this need to look like?
Kenneth LoveTreehouse Guest Teacher
Legacy Python required you to specify the class and the instance.
context = super(ClassName, self).get_context_data(**kwargs) (you'll need to put your class name in there where it says
ClassName). All that extra code is yet one more reason to upgrade to modern Python.
context = super(HomeView, self).get_context_data(**kwargs)
context = super().get_context_data(**kwargs)