There is a form. I wrote a presentation where a form is displayed by clicking on the "create an article" button. I need to make sure that after the user clicks on the button to publish, he will go to the page where all the articles are.

    1 answer 1

    To do this, you can use the redirect function in your view.

    Example of use:

     # Ваш views.py from django.views.generic import View from django.shortcuts import redirect class AddArticle(View): def post(self, *args, **kwargs): # Ваш код return redirect('blog') 

    Where is the blog in urls.py:

     # urls.py from django.urls import path from .views import Blog urlpatterns = [ # *** path('', Blog.as_view(), name='blog'), ]