Django experiments installation
Install the PostHog Python library using pip: Set the PostHog API key and host in your Next, if you haven't done so already, make sure you add your Experiments run on top of our feature flags. You can define which version of your code runs based on the return value of the feature flag: Note: Server-side experiment metrics require you to manually send the feature flag information. See this tutorial for more information. Once you've implemented the feature flag in your code, you'll enable it for a target audience by creating a new experiment in the PostHog dashboard.Install the package
RequiredConfigure PostHog
RequiredAppConfig in apps.py so that it's available everywhere:AppConfig to your settings.py under INSTALLED_APPS:Implement your experiment
RequiredRun your experiment
RequiredNext steps
RecommendedResource Description Creating an experiment How to create an experiment in PostHog Adding experiment code How to implement experiments for all platforms Statistical significance Understanding when results are meaningful Experiment insights How to analyze your experiment data More tutorials Other real-world examples and use cases