Fixed #20819 -- Return 404 instead of 500 error when ``staticfiles`` view is used in production.