python - Redirecting Django built-in login View to a URL taking user's pk as argument -
i trying redirect url taking user's pk argument after successful log-in using django's built-in login view. instead of dynamic {{ next }} variable in login.html have generic landing view of logged-in users; <input type="submit" value="login" /> <input type="hidden" name="next" value="{% url 'userredirect' %}" /> in urls.py have; url(r'^users/', views.users, name='userredirect'), url(r'^(?p<pk>\d+)/', userhome.as_view(), name='userhome'), and in views.py have @login_required def users(request): url = reverse('userhome', kwargs={'pk':request.user.id}) return httpresponseredirect(url) what doing here redirect detail view have named userhome on user model after successful login using 2 redirects not know of way redirect userhome directly (it takes user's pk argument). works , indeed redirected user's homepage when checking v...