urls.py:
path('active/(?P<active_code>.*)/$', ActiveUserView.as_view(), name='active_user'),
views.py:
class ActiveUserView(View):
def get(self,request,active_code):
users = UserProfile.objects.filter(code=active_code)
if users:
users.is_active = True
users.save()
else:
users.delete()
return HttpResponse('Fail!Register Again!')
return HttpResponseRedirect(reverse("account:user_login"))