Fixed #20819 -- Return 404 instead of 500 error when ``staticfiles`` vie...

...w is used in production.