I want a logged in user to be redirected back to the homepage when the django admin hard deletes his entry from the backend. Currently it just shows empty values for everything in the frontend after deletion. How can this be achieved so that a user session is automatically terminated and redirected to homepage after his member entry is deleted from the backend?
Asked
Active
Viewed 90 times
1 Answers
0
This could be done by deleting all the user's active sessions from the session store. There is a question I recently found that explains how to delete the sessions for a user.
Most optimized way to delete all sessions for a specific user in Django?
Once the session is deleted, the user is redirected to the login page on the next page load.