Saturday, May 21, 2022
HomeQ&AAfter 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

- Advertisment -

Stay Connected

22FansLike
25FollowersFollow
465SubscribersSubscribe

Most Popular

Recent Comments

headlamp flashlight on RTMP V/S RTSP V/S HLS