Editorial question41.7K views1,731 votes1 answer1 comment2,109 following
AI-generatedHow to make Ecto Repo configuration work in both local and production using environment variables?
In a Phoenix project the config/dev.exs file uses config :my_app, MyApp.Repo, url: \"postgres://localhost/my_app_dev\" and the app runs fine locally. In production I switch to a release and change the config to config :my_app, MyApp.Repo, url: System.get_env(\"DATABASE_URL\") . The release starts but the database connection fails, even though DATABASE_URL is