I
I
Irina Agafonova2019-05-12 19:04:13
Django
Irina Agafonova, 2019-05-12 19:04:13

How to redirect django?

URLs.py:

from django.views.generic import RedirectView
from django.urls import path
urlpatterns = [
    path('<slug:slug>/', EditorYMap.as_view(), name='base'),
    path('', RedirectView.as_view(url='/name/')),
]

Problem: Only the logged in user is redirected. If the user is not logged in, then the admin login form opens before the direction.
5cd843f053144042716188.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question