---
title: Deploy Flagsmith with AI on Blossom
url: "/deploy/flagsmith/"
canonical_url: https://blossom88.com/deploy/flagsmith/
markdown_url: https://blossom88.com/deploy/flagsmith.md
summary: Run Flagsmith with managed PostgreSQL and check a feature flag in QA before
  you turn it on in other environments.
categories:
- deployment
- feature-flags
- developer-tools
stack:
- Python
- Django
- React
- PostgreSQL
---

# Deploy Flagsmith with AI on Blossom

[Flagsmith](https://www.flagsmith.com/) lets you turn app features on or
off without a redeploy. You can enable a feature in QA and keep it off
in Preview.

![The checkout banner feature flag enabled in Workshop QA.](/deploy/assets/images/flagsmith/qa-flag.webp)

![The same checkout banner feature flag disabled in Workshop Preview.](/deploy/assets/images/flagsmith/preview-flag.webp)

## Ask Your Agent

> **Ask your AI agent:** Deploy Flagsmith on Blossom with managed Postgres. Help me turn on a feature flag in QA.
>
> Follow this guide: https://blossom88.com/deploy/flagsmith/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and choose a Blossom Cloud Location when you log in. You can also use [Blossom BYOC (bring your own cloud)](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#blossom-byoc).

## How It Runs

| Part | Role | Where |
|---|---|---|
| Flagsmith dashboard and API | Manage and read feature flags | HTTPS with Blossom Account access |
| Task processor | Run Flagsmith background tasks | Private App Service |
| PostgreSQL | Store projects, flags, and environment settings | Managed by Blossom |

## Deploy Flagsmith

Deploy the [Flagsmith Open Source edition](https://github.com/Flagsmith/flagsmith/blob/v2.295.2/LICENSE.md)
and create the first administrator account on your private endpoint.

<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom profile:show
    blossom app:create --data app.yml
    blossom environment:create --data environment.yml
    blossom database_instance:create --data postgres.yml
    blossom environment_link:create --data postgres-link.yml
    blossom environment:deploy_hooks:update --id environment-100 --data migrations.yml
    blossom service:create --data web.yml
    blossom service:create --data processor.yml
    blossom env_var:push --environment environment-100 --file .env.runtime
    blossom environment:deploy --id environment-100 --follow

</details>

<details class="optional-reading" markdown="1">
<summary>Notes for your agent</summary>

- Link managed PostgreSQL as `DATABASE_URL`. Run `flagsmith migrate`
  in the Release Phase and keep `DJANGO_SECRET_KEY` and
  `WAREHOUSE_CREDENTIALS_SECRET` stable across releases.
- Use the official image for both Services. Run `flagsmith serve` on
  port 8000 and set `FLAGSMITH_DOMAIN` and `DJANGO_ALLOWED_HOSTS` from
  the web Service host. Keep the `flagsmith start task-processor`
  Service private and set `TASK_RUN_METHOD=TASK_PROCESSOR`.
- Require Blossom Account access for the web Service. The dashboard
  fetches public defaults from the Flagsmith Edge API. A client using
  the private HTTPS API also needs Blossom access.

</details>

## Create the QA and Preview Environments

In your project, create QA and Preview environments. Add a
`checkout_banner` feature flag with its default set to off.

## Turn the Flag On in QA

Enable the flag in QA. Point the
[Flagsmith SDK](https://docs.flagsmith.com/integrating-with-flagsmith/integration-overview)
at your private API with the matching environment key. QA should read
on and Preview should still read off.

> **Ask your AI agent:** Check that the checkout banner flag is on in QA and off in Preview.

> Follow this guide: https://blossom88.com/deploy/flagsmith/



## Keep It Running

Keep the same PostgreSQL link and application secrets when updating.
Use a fresh SDK client to check both environments after the deploy.

## What You Get

- A private dashboard for managing feature flags
- A checkout flag you can turn on in QA
- Independent flag settings for QA and Preview
- An SDK check that reads the current flag values

Tested on Blossom: The SDK still read QA on and Preview off after both App Containers were replaced.
