-
Notifications
You must be signed in to change notification settings - Fork 517
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
base: master
Are you sure you want to change the base?
Conversation
@sortafreel is attempting to deploy a commit to the PostHog Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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`. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"? 🤔
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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 :)
Changes
Please describe.
Add screenshots or screen recordings for visual / UI-focused changes.
Checklist
vercel.json
Article checklist