I am trying to redirect to a particular url after the user logs in. I am using django rest framework's built-in user authentication. I have tried the following code:
In urls.py, I have the following:
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^register/$',views.CreateUserView.as_view(),name='user'),
url(r'^api-auth/',include('rest_framework.urls',namespace='rest_framework')),
url(r'^',include(router.urls)),
]
In settings.py, I have included the following:
LOGIN_REDIRECT_URL = '/task'
I am on the following page 'localhost/register' and after creating a user and logging in, it redirects to same 'localhost/register page'. How do I redirect to the homepage? Is there anything I am missing?