title: Question in one of Cory Schafer's tutorials for Django
body: <p>I am trying to learn Django by watching the Django course by Cory Schafer, and I'm just confused about the part where Cory used redirect after the registration process.</p>
  <pre><code>    if request.method == 'POST':
          form = UserRegisterForm(request.POST)
          if form.is_valid():
              form.save()
              username = form.cleaned_data.get('username')
              messages.success(request, f'Account created for {username}!')
              return redirect('blog-home')
      else:
          form = UserRegisterForm()
  
      return render(request, 'users/register.html', {'form': form})
  </code></pre>
  <p>He used the <code>return redirect('blog-home')</code> and managed to show the message <code>Account created for {username}</code> in the template. But I'm not sure how he managed to access that message in the template without ever passing it similar with what we do with render method.</p>
  <p>Example of render method I learned is below, it's always passing the 3rd argument so that in the template we can manage to access it. But I have no idea how the message was passed via redirect method.</p>
  <p><code>return render(request, 'blog/home.html', context)</code></p>