I have a django site where I want to use the "admin panel" at the top of each page without an administrator for employees. It will contain useful things like page editing tools, etc.
The problem comes from me using the @cache_page decorator on a lot of pages. If an ordinary user clicks on a page, the cached version appears without an admin panel (even for administrator users), and if an administrator first gets to the page, ordinary users see the admin panel.
I could tediously go through the templates by adding regional cache blocks, but there are many templates, and life is too short.
Ideally, there would be a way to tell caching to ignore cache requests / set of requests from admin users ... But I don't know how best to implement this.
How would you deal with this problem?
source share