Hacker News new | past | comments | ask | show | jobs | submit login

You're absolutely correct in saying that you shouldn't have to create boilerplate to have a footer with nav links on the bottom of every page.

I believe that the preferred way to do this in Django is by either creating a custom template tag, or by using template inheritance.

Template inheritance: create a base.html template with a {% block footer %} that can inherit and/or over ride it from any other template that needs.

Template Tags:

Create a simple tag that renders the comments thread, what's related links, etc... in a separate tag. This is the "preferred" way if you need to query the database for something that's related to multiple different views. For an example of that, see the django-pagination app.




Template inheritance is the way to go, and it's one of the most important features necesary to create modular sites.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: