I have small problem with redirecting from one view to another according to Django topic.
Already read some answers like: ans_1, ans_2, ans_3, but can't find solution.
Instead get an error:
Reverse for 'add_tasks_continue' not found. 'add_tasks_continue' is not a valid view function or pattern name.
Goal: redirect from one view to another with some data.
My view functions:
def add_day_tasks(request):
users = User.objects.all()
if request.method == "POST":
...
return redirect('add_tasks_continue', data=locals())
def add_tasks_continue(request, data):
...
return render(request, 'eventscalendar/add_task_continue.html', locals())
My url:
app_name = 'calendar'
urlpatterns = [
url(r'^$', calendar),
url(r'^calendar/add_day_task/$', add_day_tasks),
url(r'^calendar/add_task_continue/$', add_tasks_continue, name='add_tasks_continue'),
]
Thank you all for your time