redirect back react-router-dom code example
Example 1: redirect react router
<Route exact path="/">
{loggedIn ? <Redirect to="/profile" /> : <HomePage />}
</Route>
Example 2: redirect react router
<Redirect to="/somewhere/else" />
Example 3: import redirect
from django.shortcuts import redirect