Thursday, January 21, 2021
Home Q&A After logout clicking, the back button page is open in Django why?

After logout clicking, the back button page is open in Django why?

This is actully a cache problem.

You can use cache_control decorator to force no cache on views

from django.views.decorators.cache import cache_control

@cache_control(no_cache=True, must_revalidate=True)
def func()
  #some code
  return

This will force the browser to make request to server.

You should also write your own decorator that replaces @login_required so that you don’t need to use both on every page.

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Best Tricks For Play & Win Ludo

Ludo King Game has now become the world’s popular game. Everyone, children, old and young, like to play this game.

How To Delete Facebook Account Permanently?

Today we will know about one problem, which people keep talking about, today we will know how to delete Facebook account. With...

Bootstrap Media Queries

Since Bootstrap is developed to be mobile-first, we use a handful of media queries to create sensible breakpoints for our layouts and interfaces. These...

ThemeRaja Review – Best GPL Plugins and Themes Seller

Best WordPress GPL Themes Plugins site in 2020 Hi, Friends If you want to get the best WordPress theme or plugin...

Recent Comments