Creating reviews
To allow users to create reviews, we need to follow the next steps:
- Update the
movies.show
template. - Define the
create_review
function. - Configure the
create
review
URL.
Updating the movies.show template
We will include a form to allow authenticated users to create reviews. This form will be included in the movies.show
template. In the /movies/templates/movies/show.html
file, add the following, as presented in bold:
… <p><b>Price:</b> ${{ template_data.movie.price }}</p> {% if user.is_authenticated %} <div class="container mt-4"> <div class="row justify-content-center"> ...