From 9577c2d27d7ebb4794f056b36be928b81a6890eb Mon Sep 17 00:00:00 2001 From: d42 Date: Wed, 10 Oct 2018 21:18:06 +0200 Subject: [PATCH] yolo admin login redirect --- auth/views.py | 4 ++++ spejstore/urls.py | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 auth/views.py 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')),