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 trialNursultan Bolatbayev
16,774 PointsThe purpose of block.super?
I cant understand the purpose of block.super in template. If I delete it nothing is changed. It says it loads a content from parent template, but which?
2 Answers
Chris Freeman
Treehouse Moderator 68,457 PointsWhen a template is rendered, any blocks
defined will overwrite the content in the extended template. Using the block.super
will retain the content that is in the extended parent template. If the parent template block has no content, such as:
{% block title %}{% endblock title %}
There is no parent content to include, so removing the block.super
reference won't change anything.
If this is not your case, then please post the section of the extended template containing the referenced block and the current template referencing block.super
.
Jacinto Jacinto
Python Web Development Techdegree Student 7,869 PointsHey Chris! I took a long break from my techdegree and im getting back into it. Regarding login required and user authentication, what lesson did we cover that? How do I log into mysite, we dont even have user models.
Chris Freeman
Treehouse Moderator 68,457 PointsOff hand, I donβt remember the specific lesson. You can use the manage module to create a new superuser admin login.
$ python manage.py createsuperuser
Then, login in as admin to create new users as needed.
Post back if you need more help. Good luck!!!