diff --git a/auth/views.py b/auth/views.py new file mode 100644 index 0000000..ae19948 --- /dev/null +++ b/auth/views.py @@ -0,0 +1,4 @@ +from django.shortcuts import redirect + +def auth_redirect(request): + return redirect('social:begin', 'hswaw') diff --git a/spejstore/urls.py b/spejstore/urls.py index 366fa95..9cb95f3 100644 --- a/spejstore/urls.py +++ b/spejstore/urls.py @@ -12,6 +12,8 @@ from rest_framework import routers from storage import apiviews +from auth.views import auth_redirect + router = routers.DefaultRouter() router.register(r'items', apiviews.ItemViewSet) @@ -20,6 +22,7 @@ router.register(r'labels', apiviews.LabelViewSet) # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API. urlpatterns = [ + url(r'^admin/login/.*', auth_redirect), url(r'^admin/', admin.site.urls), url(r'^select2/', include('django_select2.urls')),