Skip to content

fix: update localhost port in examples from 8000 to 8010#453

Open
parinporecha wants to merge 2 commits intoPostHog:masterfrom
parinporecha:fix/example
Open

fix: update localhost port in examples from 8000 to 8010#453
parinporecha wants to merge 2 commits intoPostHog:masterfrom
parinporecha:fix/example

Conversation

@parinporecha
Copy link

I was trying out the example.py on my local machine and ran into these errors -

ERROR:posthog:[FEATURE FLAGS] Unable to get feature variants: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /flags/?v=2 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x79abc05d9190>: Failed to establish a new connection: [Errno 111] Connection refused'))

ERROR:posthog:error uploading: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /batch/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x79abbf066840>: Failed to establish a new connection: [Errno 111] Connection refused'))

/flags and /batch endpoints are not in the Django backend on :8000. For local development we need to point to the proxy port so it can reroute to the right service.

@parinporecha parinporecha changed the title fix: update default localhost port from 8000 to 8010 fix: update localhost port in example.py from 8000 to 8010 Mar 5, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 5, 2026

Comments Outside Diff (1)

  1. General comment

    Port not updated to match fix

    examples/remote_config.py still uses localhost:8000, but this PR's motivation is that /flags/, /batch/, and related PostHog endpoints are not served by the Django backend on port 8000 — they need the proxy at port 8010. The get_remote_config_payload call in this file will hit the same connection error described in the PR.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: examples/remote_config.py
    Line: 11
    
    Comment:
    **Port not updated to match fix**
    
    `examples/remote_config.py` still uses `localhost:8000`, but this PR's motivation is that `/flags/`, `/batch/`, and related PostHog endpoints are not served by the Django backend on port 8000 — they need the proxy at port 8010. The `get_remote_config_payload` call in this file will hit the same connection error described in the PR.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: 32a9a17

@parinporecha parinporecha changed the title fix: update localhost port in example.py from 8000 to 8010 fix: update localhost port in examples from 8000 to 8010 Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant