Env vars are used very much.
Other approach is:
Having config.yaml (or any format) file which has constants eg. connection_url, db_hosts etc. And this file is not committed in repo. For dev/local purposes have a configs.yaml.sample file with defaults settings.