File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 77
88import os
99
10- # The `PORT` env var is set automatically for web dynos and when using `heroku local`:
10+ # On Heroku, web dynos must bind to the port number specified via the `PORT` env var. This
11+ # env var is set automatically for web dynos and also when using `heroku local` locally:
1112# https://devcenter.heroku.com/articles/dyno-startup-behavior#port-binding-of-web-dynos
1213# https://devcenter.heroku.com/articles/heroku-local
13- _port = os .environ .get ("PORT" , 5006 )
14- # Bind to the IPv6 interface instead of the gunicorn default of IPv4, so the app works in IPv6-only
15- # environments. IPv4 connections will still work so long as `IPV6_V6ONLY` hasn't been enabled.
16- bind = [f"[::]:{ _port } " ]
14+ # Gunicorn will automatically use the `PORT` env var, however, by default it will bind to the
15+ # port using the IPv4 interface (`0.0.0.0`). We configure the binding manually to make it bind
16+ # to the IPv6 interface (`::`) instead, so that the app works in IPv6-only environments too.
17+ # (IPv4 connections will still work so long as `IPV6_V6ONLY` hasn't been enabled.)
18+ bind = ["[::]:{}" .format (os .environ .get ("PORT" , 5006 ))]
1719
1820# The default `sync` worker is more suited to CPU/network-bandwidth bound workloads, so we
1921# instead use the thread based worker type for improved support of blocking I/O workloads:
You can’t perform that action at this time.
0 commit comments