im new to django. actually i want on correct login user it redirect to my index page. here is my login handler.
def login(request):
template = \"../templates
if you will use a default login handler - there is a default setting LOGIN_REDIRECT_URL.
You need to setup Django decorators and setup the settings for it to work. Here is a link for Django Decorators https://docs.djangoproject.com/en/dev/topics/http/decorators/
Add these to your settings.py:
LOGIN_URL = '/login/' LOGIN_REDIRECT_URL = '/homepage/'
Just change the values according to your specifications. (/login/ and /homepage/ are URLs).
You need to return a HttpResponseRedirect