Use request.method == 'POST' to check if the request is a post request