Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add more details/tips on Pycharm debugging and connecting to local Clickhouse. #10900

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sortafreel
Copy link
Contributor

Changes

Please describe.

Add screenshots or screen recordings for visual / UI-focused changes.

Checklist

  • Words are spelled using American English
  • Titles are in sentence case
  • Feature names are in sentence case too
  • Use relative URLs for internal links
  • If I moved a page, I added a redirect in vercel.json
  • Remove this template if you're not going to fill it out!

Article checklist

  • I've added (at least) 3-5 internal links to this new article
  • I've added keywords for this page to the rank tracker in Ahrefs
  • I've checked the preview build of the article
  • The date on the article is today's date
  • I've added this to the relevant "Tutorials and guides" docs page (if applicable)

Copy link

vercel bot commented Mar 10, 2025

@sortafreel is attempting to deploy a commit to the PostHog Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Mar 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog ❌ Failed (Inspect) Mar 10, 2025 8:20pm

Comment on lines +513 to +526
If you are using the `mprocs` approach to Posthog (`DEBUG=1 ./bin/start`) and want to debug backend service through PyCharm, you need to:

1. Start containers through Docker (for example, using regular `docker compose -f docker-compose.dev.yml -v up`).
2. Create a Pycharm configuration to start `uvicorn` manually (instead of the `mprocs` script).
- Select configurations in the top right corner > `Edit Configurations...`.
- Add new `Python` configuration (`+` button in the top left corner of the `Configurations` window).
- Set `module` (instead of `script`) to `uvicorn`.
- Set script parameters (should be identical to `mprocs` backend script parameters at `posthog/bin/start-backend`):
```
--reload posthog.asgi:application --host 0.0.0.0 --log-level debug --reload-include "posthog/" --reload-include "ee/" --reload-include "products/"
```
- Set the working directory to the `posthog` root.
- Add `DEBUG=1` to the configuration's environmental variables (if you want to replicate the default behavior),
3. Start `posthog` through `DEBUG=1 ./bin/start`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should already be pycharm run configrations... 🤔

although i bet they don't use uvicorn

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by "there should already be PyCharm run configurations"? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Rework as a a Pycharm configuration (double-check if it's needed as existing Django config already exists).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add this as a pycharm run configuration instead of as docs :)

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.

2 participants