[Solved] undefined name in function ‘redirect’


You need to import redirect from django.shortcut with

from django.shortcuts import redirect

This is well documented in the Django’s shortcut documentation.

solved undefined name in function ‘redirect’