Basically we want to do exactly what django.contrib.auth did with their urls.
This is how the user would create login and logout views with the current version:
url(r'^login/$', views.CustomSocialLoginView.as_view(), name='login'),
url(r'^logout/$', partial(auth_views.logout, template_name='logout.html'), name='logout'),
Instead we them to simply go
url(r'', include('django_social_pill.urls'), namespace='social_pill'),
To achieve this, we have to make the following view more generic:
class CustomSocialLoginView(TemplateView):
template_name = 'login.html'
def get(self, request, *args, **kwargs):
if request.user.is_authenticated():
return redirect('users:profile')
return super().get(request, *args, **kwargs)
so that we could replace the template and the redirect url with an arbitrary one.
Basically we want to do exactly what
django.contrib.authdid with their urls.This is how the user would create login and logout views with the current version:
Instead we them to simply go
To achieve this, we have to make the following view more generic:
so that we could replace the template and the redirect url with an arbitrary one.