The urls.py is of course only evaluated once: at Apache load time, which means the data in the template became stale and is not dynamic. This change should cause the lookup to happen at each page view.