hey guys i have the following codes, I'm trying to redirect the GoalUpdate view to GoalPageView , but I get the following Error:
Reverse for 'Goals.views.GoalPageView' with keyword arguments '{'kwargs': {'username': 'admin', 'goal_id': '1'}}' not found. 1 pattern(s) tried: ['people/(?P[^/]+)/goals/(?P<goal_id>[^/]+)/\Z']
My URLs
urlpatterns = [
path('<username>/goals/',GoalsView,name='Goals'),
path('<username>/goals/<goal_id>/',GoalPageView,name='Goal Page'),
path('<username>/goals/<goal_id>/update/',GoalUpdate,name='Goal Update'),
]
My Views:
def GoalPageView(request,username,goal_id):
some view code
return render(request,'goal_page.html',context=context)
def GoalUpdate(request,username,goal_id):
Some View Code
return redirect(GoalPageView,kwargs={'username':username,'goal_id':goal_id})