I have a requirement to display a particular page in a website that is developed in Python/Django from another website. If the user is logged into the python/Django site then display the requested page. Currently i'm using the 'request.user.is_authenticated()' method to check whether the user is logged in or not . If the user hasn't logged in then should redirect to the /login page and once the user has entered his login credentials correctly redirect to the particular requested page.
The problem is if the user is not logged in then should redirect to login page. In this case the URL gets changed . We need to redirect back to the previous URL once the user is logged in. How can i achieve this? The URL 'm calling is not a static URL. The parameters in the URL changes. I'm searching for some built in methods in Django to achieve this..
Does some have a better idea to solve this.
Thanks in advance.