[Django]-How to load objects from model on server start up?

1👍

I think you need Template context processors.

Here is a nice tutorial by James Bennett on that:

http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/

1👍

Well, I’m very new to django, and maybe I’m wrong, but I think you are looking for something like caching. Read the docs, and decide whether is it fits you or not.

👤balazs

1👍

You can cache just a part of your view:

https://docs.djangoproject.com/en/1.3/topics/cache/#template-fragment-caching

surround your navigation bar like this:

{% cache 500 navbar %}
   ... put your navbar code
{% endcache %}

and ensure to have

{% load cache %}

at the top of your template or the base template.

Leave a comment