[1.7.x] Refs #23430 -- gunicorn wants a module, not file

Backport of fa74dba994 from master