Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialcompetent- fellow
5,846 Points"name 'render' is not defined"
I was able to import "utils". However, "render" still did not work.
for label, value in balances.items(): render("The label {} has a value of {}".format(label,value)) --> NameError: name 'render' is not defined
I could not find any documentation for utils' render function online.
Instead, I just used print() and that worked just fine. Perhaps this is a version issue?
3 Answers
matth89
17,826 PointsHi Craig, did you import render with from django.shortcuts import render
?
competent- fellow
5,846 PointsHello Matt. Thanks for your advice. I am not sure django's render does the same thing. I get this error message:
TypeError: render() missing 1 required positional argument: 'template_name'
matth89
17,826 PointsApologies, I may have misunderstood what was happening. Could you link this to the challenge or video you are working with?
competent- fellow
5,846 PointsHello Matt, this is the challenge: https://teamtreehouse.com/library/introduction-to-pandas/meet-pandas/accessing-a-series
competent- fellow
5,846 Pointscompetent- fellow
5,846 PointsHello Mat. No. I did so with either:
matth89
17,826 Pointsmatth89
17,826 PointsRight on. Use the import I mentioned, and you should be good to go!