1๐
โ
As per your url definition, the new_view
url does not take any parameter hence the error that you are getting.
But passing data in url, specifically large data as you mentioned, is not good. Cookies or django sessions are much better option.
To use django session update your view as
def sender(request):
if form.is_valid():
cd = form.cleaned_data
letter = cd['post']
request.session['post_data'] = letter
next = reverse('new_view',)
return HttpResponseRedirect(next)
def new_view(request,):
post_data = request.session.get('post_data')
return render(request, 'new_view.html', {'post': post})
๐คRohan
Source:stackexchange.com