# Release Notes History

> Historical release notes and changelog for older versions of SaaS Pegasus Django boilerplate.

These are old releases.

For the latest updates, see the [Release Notes](/release-notes/) page.

## Version 2024.12.1

[Section titled “Version 2024.12.1”](#version-2024121)

This is a minor hotfix release for 2024.12

* **Fixed a bug where the delete workflow was broken for apps created by the Pegasus CLI on non-Tailwind builds.** This happened becasue the “css\_framework” cli option was accidentally missing from `pegasus-config.yml`. Thanks Robert for reporting!
* Updated the README instructions for setting up pre-commit hooks when using uv.

*Jan 13, 2025*

## Version 2024.12

[Section titled “Version 2024.12”](#version-202412)

content/ This release adds first-class support for using uv as a complete replacement for development and production workflows (see below), and has a handful of fixes/changes.

### UV support!

[Section titled “UV support!”](#uv-support)

This release adds full support for [uv](https://docs.astral.sh/uv/) as a replacement package manager for your project. You can use uv by selecting the new “uv” as your “Python package manager” on your project settings page.

When you select uv the following changes will be made:

* All requirements.in / requirements.txt files are removed.
* Your project requirements will now be listed in your `pyproject.toml` file.
  * Development and production dependencies will be listed under separate dependency-groups.
* Your pinned project requirements will be listed in a new `uv.lock` file.
* Docker containers (in development and production) will use `uv` to set up and manage the Python environment.
* A `make uv` target will be added to Docker builds to run `uv` commands in your container.

The main benefits of using uv are:

* Speed. It is just way, way faster to anything related to package management.
* Easier to setup and install Python.
* Lock files (pinned versions) are consistent across any platform.
* More tooling.
* Speed. (It’s so fast we put it twice.)

There will be a longer write up about uv released very soon, but in the meantime you can review the updated [python documentation](/python/setup) and new [uv documentation](/python/uv).

The rest of the docs have been updated to accommodate uv, though it’s possible there are some places that were missed. If you spot any issues in the docs, get in touch!

### Other fixes

[Section titled “Other fixes”](#other-fixes)

* **Upgraded the pegasus cli to fix an issue where the generated list views were not properly scoped to the appropriate team / user.** If you used the CLI to generate any apps it’s highly recommended that you check that you are not exposing objects that should not be viewable.

### Other updates

[Section titled “Other updates”](#other-updates)

* **Changed the default set up of social logins to use settings-based configuration instead of `SocialApps` in the database.** See the upgrade notes if you are using social logins to prevent issues. Thanks Alex for the suggestion and for helping with the updated documentation!
* Updated the default flowbite setup to disable the forms plugin. This was causing styling conflicts with the default DaisyUI styles on certain form elements, including checkboxes.
* Re-formatted the default form input template for readability.

### Upgrading

[Section titled “Upgrading”](#upgrading)

To migrate an existing project to `uv` see [this guide](/cookbooks/#migrating-from-pip-tools-to-uv).

If your application was already using social logins defined in the database, the new settings-based declaration will conflict and cause errors on social login. To fix this you can either delete the `APPS` section of the relevant service in `settings.SOCIALACCOUNT_PROVIDERS`, or you can move the credentials into your project environment (e.g. `.env`) and delete relevant the `SocialApp` from the Django admin.

*November 29, 2024*

## Version 2024.11.3

[Section titled “Version 2024.11.3”](#version-2024113)

This is a minor maintenance release with a few changes in preparation for adding `uv` support (coming soon!).

### Changed

[Section titled “Changed”](#changed)

* Pinned the version of `uv` used in CI and Dockerfiles.
* Added `venv` and `.venv` directories to the `.dockerignore` file and `make translations` target.
* The `make requirements` command now restarts containers in the background, making it easier to combine with other make targets.
* Added a catch-all to the `Makefile` to prevent error messages when running `make npm-install <package_name>` and similar commands.
* Updated README commands to consistently use `python manage.py` instead of just `./manage.py`.
* Made some minor formatting changes to `pyproject.toml`.
* Fixed the link to the multi-stage dockerfile docs in `Dockerfile.web`
* Upgraded a number of Python packages.
* Updated the `default_stages` of the `.pre-commit-config.yaml` file to the latest expected format (`pre-commit`).

*Nov 21, 2024*

## Version 2024.11.2

[Section titled “Version 2024.11.2”](#version-2024112)

This release adds the ability to disable dark mode on Tailwind, upgrades front end libraries, bumps the API client version, and has a handful of other small changes and fixes.

## Added

[Section titled “Added”](#added)

* **Added a new build option to disable dark mode for Tailwind builds.** (Thanks Arno for suggesting!)
* Added basic user-facing error messages to the standalone front end sign up and login workflows.

## Changed

[Section titled “Changed”](#changed-1)

* **Upgraded all JavaScript dependencies.**
* **Updated the API client to use the latest version 7.9.0, and updated the standalone front end to work with the latest changes.**
* Updated template-partials installation to be manually loaded, to allow for easier integration with other templating systems like django-cotton.
* Moved active tab highlighting to the base view in the example object demo.
* Made a few very minor edits to comments and whitespace in a few places.

## Fixed

[Section titled “Fixed”](#fixed)

* Fixed a bug where your migrations and tests would fail if your project name was > 50 characters (thanks Bernard for reporting!).
* Fixed a bug in the group chat demo where submitting an empty room name would take you to a 404 page.
* The `docker_startup.sh` file is no longer included if you are not using a docker-based deploy platform.
* Updated the `config/README` file which had outdated information that predated the migration to Kamal 2. (Thanks Arno for reporting!)
* Improved comments in the kamal `secrets` file and `.env` files. (Thanks Arno for suggesting!)

## Removed

[Section titled “Removed”](#removed)

* The `.env` file is no longer included in zip downloads. This file was already removed from Github builds so this just makes the two consistent. Projects should create `.env` file from the `.env.example` file.
* Removed the `migrate_customers_to_teams` management command. This was added for an upgrade two years ago, and is assumed to be no longer needed.

*Nov 14 2024*

## Version 2024.11.1

[Section titled “Version 2024.11.1”](#version-2024111)

This is a minor hotfix release.

### Fixed

[Section titled “Fixed”](#fixed-1)

* Fixed an issue where the team selector was accidentally transparent in Tailwind builds.
* Removed shadcn template that was accidentally included even if shadcn was disabled.

### Updated

[Section titled “Updated”](#updated)

* Removed extra whitespace from `form_tags.py`. (Thanks Brennon for reporting!)
* Updated `make help` to allow for commands defined in `custom.mk` with digits to also show up. (Thanks Arno for suggesting!)

*Nov 4 2024*

## Version 2024.11

[Section titled “Version 2024.11”](#version-202411)

This is a feature release with an emphasis on improving the Tailwind CSS experience with Pegasus.

Watch the video below for a demo, or read on for the highlights.

### Dark mode improvements

[Section titled “Dark mode improvements”](#dark-mode-improvements)

A dark mode selector was added to the navigation, allowing users to easily toggle between light, dark, and “system default” mode. The user’s selection is preserved server-side in the session object, which also helps to prevent flickering across page loads.

### Better Theme Support

[Section titled “Better Theme Support”](#better-theme-support)

It’s now easier than ever to change your project’s theme. Each project now supports a default light and dark theme which will be used throughout the site. The default themes need only be changed in `tailwind.config.js`, and `settings.py` and everything else is taken care of.

See the updated [tailwind theme documentation](/css/tailwind/#changing-your-themes) for more details.

### New shadcn integration and demo dashboard

[Section titled “New shadcn integration and demo dashboard”](#new-shadcn-integration-and-demo-dashboard)

A new build setting allows you to build your project with [shadcn/ui](https://ui.shadcn.com/) installed. Shadcn is a great and versatile component library for React and Tailwind, but it is difficult to integrate it into a Django project without building a separate front end. Now Pegasus takes care of that integration for you, and provides a reference dashboard implementation of how to work with the library.

The reference dashboard is a hybrid single-page React app served by Django. It uses the same colors as the DaisyUI theme, and will update when you change your theme, and has many interactive components. However, it is not connected to any backend data—it is just a UI example.

Read more in the [shadcn docs here](/css/tailwind/#shadcn).

### New flowbite integration and demo component page

[Section titled “New flowbite integration and demo component page”](#new-flowbite-integration-and-demo-component-page)

Another new build setting allows you to build your project with [flowbite](https://flowbite.com/) installed. Flowbite is another great component library for Tailwind and does *not* use React—making it a great fit for htmx projects. If you enable this setting, flowbite will automatically be installed and you can drop flowbite components into any Django template. The reference page has an example of a few of these components.

Read more in the [flowbite docs here](/css/tailwind/#flowbite).

### Other updates

[Section titled “Other updates”](#other-updates-1)

* **Upgraded all Python packages to their latest versions.**

* **[uv](https://docs.astral.sh/uv/) is now used to install Python packages in Docker files and Github actions.**

  * Also updated `make pip-compile` target to use `uv`.
  * This resulted in minor changes to all `requirements.txt` files.

* **Team invitation pages now prompt a user to log in instead of sign up if the email is associated with a known account.** (Thanks Daniel for suggesting!)

* Your configured Github username, if available, will be used in a few places instead of a default value. (Thanks Richard for suggesting!)

* Added `bg-base-100` to the `<body>` tag of the base template and removed it from other components where it was now redundant. This improves theming support when themes heavily modify the base color. (Tailwind builds only)

* Added equals signs to `ENV` declarations in production Docker files, for consistency. (Thanks Denis for suggesting!)

* Slightly improved the styling of the e-commerce app.

* Overhauled the [Tailwind CSS documentation](/css/tailwind).

**Updates to the CLI ([release notes](https://github.com/saaspegasus/pegasus-cli/releases))**

* Fixed a bug on certain environments where the `pegasus` command conflicted with a local `pegasus` folder, causing import errors running the CLI.
* Apps created with `startapp` now use a `POST` for deletion instead of a `GET`.
* Deletion now includes a modal confirmation (Tailwind and Bulma builds only).

### Upgrading

[Section titled “Upgrading”](#upgrading-1)

If you’re using Docker the `make upgrade` command won’t work out-of-the-box due to the change in how requirements files are managed. You will first have to rebuild your containers with:

```bash
make build
```

or

```bash
docker compose build
```

After that, you should be able to run `make upgrade` as normal.

*Nov 1, 2024*

## Version 2024.10

[Section titled “Version 2024.10”](#version-202410)

This release upgrades Kamal deployment to Kamal 2 and dramatically simplifies the Kamal deployment process.

### Kamal 2 deployment and related changes

[Section titled “Kamal 2 deployment and related changes”](#kamal-2-deployment-and-related-changes)

In the upgrade to Kamal 2, the following changes were made:

* Updated Kamal to run from the root project directory instead of the `deploy` subdirectory.
  * Also moved the config file was also moved from `deploy/config/deploy.yml` to `config/deploy.yml`
* Moved environment secrets from `deploy/.env` to `.kamal/secrets` to match Kamal 2’s recommendation.
* Kamal can now be installed and run with Docker without any additional workarounds [as described here](https://kamal-deploy.org/docs/installation/) The custom docker set up instructions have been removed.
* Kamal is now run as root by default, which dramatically simplifies the server setup process. There is now no need to run any manual steps to set up your server.
* Kamal now creates and manages its own docker network.
* Traefik has been dropped in favor of `kamal-proxy` for the proxy server, as per the new Kamal defaults.
* The `.gitignore` and `.dockerignore` files were updated to reflect the new structure.
* Added `apps.web.middleware.healthchecks.HealthCheckMiddleware` to workaround Kamal health checks and Django security features, [as outlined here](https://github.com/basecamp/kamal/issues/992#issuecomment-2381122195).
* Removed unnecessary media directory set up from `Dockerfile.web`. It is recommended to use an external storage service for media files and not the Docker container.

In addition, there were a few changes that affect projects that aren’t using Kamal:

* `apps.web.locale_middleware` was moved to `apps.web.middleware.locale`
* `docker_startup.sh` was moved from the `deploy` folder to the project root.

The [Kamal documentation](/deployment/kamal) has been updated to reflect these changes.

### Other fixes

[Section titled “Other fixes”](#other-fixes-1)

* **Subscriptions in a “past due” state are now treated as “active” for the purposes of feature gating and accessing the billing portal.** This is more consistent with [how Stripe treats subscriptions in this state](https://docs.stripe.com/api/subscriptions/object#subscription_object-status). (Thanks Luc for suggesting!)
* Fixed a bug where several `make` targets mistakenly included a `--no-deps` flag which would fail if your database container was not running. (Thanks Gary for reporting!)
* Fixed an issue where Stripe subscription webhooks weren’t properly handled if you were using the embedded Stripe pricing table. (Thanks Andrew for reporting!)
* Fixed an issue introduced in 2024.9 where Stripe ecommerce webhooks weren’t always processed correctly.
* Added a migration file to automatically work around [this dj-stripe issue](https://github.com/dj-stripe/dj-stripe/issues/2038) so that it wasn’t a manual process.

*Oct 15, 2024*

## Version 2024.9.3

[Section titled “Version 2024.9.3”](#version-202493)

This release is mainly [an update to the CLI](https://github.com/saaspegasus/pegasus-cli/releases/tag/v0.3):

### CLI updates

[Section titled “CLI updates”](#cli-updates)

* **You can now generate apps that work seamlessly with Pegasus teams** (will use `BaseTeamModel` and add the team slug and permissions checks to all urls and views).
* The CLI now generates a default `admin.py` config for each data model.
* User foreign keys now use `settings.AUTH_USER_MODEL` instead of being hardcoded to `apps.users.models.CustomUser`.

### Other changes

[Section titled “Other changes”](#other-changes)

* Fixed an issue where HTMX links without href tags weren’t showing a pointer cursor on some CSS frameworks.
* Add default region to Redis and Postgres configurations in `render.yaml` to make it easier to find/replace them when changing your project’s region. (Thanks Jacob for suggesting!)

*Sep 26, 2024*

## Version 2024.9.2

[Section titled “Version 2024.9.2”](#version-202492)

This release fixes a bug that prevented the CLI from running on Windows machines. Thanks Jonathan for reporting!

If you don’t want to upgrade you can just `pip install pegasus-cli==0.2.1` to apply the fix.

*Sep 20, 2024*

## Version 2024.9.1

[Section titled “Version 2024.9.1”](#version-202491)

This release fixes a few things in the 2024.9 release.

* Updated the `bootstrap_ecommerce` management command to create `ProductConfiguration` objects for all active Products in Stripe.
* Fixed an issue on the ecommerce homepage where a closing `</div>` tag was misplaced if a product didn’t have a default price set.

*Sep 18, 2024*

## Version 2024.9

[Section titled “Version 2024.9”](#version-20249)

There are two big updates in this release:

1. The Pegasus CLI, which allows you to instantly spin up new apps.
2. E-Commerce/Payments improvements.

### The Pegasus CLI

[Section titled “The Pegasus CLI”](#the-pegasus-cli)

The [Pegasus CLI](https://github.com/saaspegasus/pegasus-cli/) is a standalone command-line tool that allows you to instantly spin up new Django apps. You can specify as many data models as you want and it will generate a starting CRUD interface for each of them.

Here’s a quick demo:

**At the moment the CLI only supports HTMX build of Pegasus.** A React-based implementation is planned for a future date.

Huge thanks to Peter for his excellent [Pegasus example apps](https://github.com/pcherna/pegasus-example-apps-v2) project which served as a reference for implementing the CRUD application and pagination.

### E-Commerce / Payments demo improvements

[Section titled “E-Commerce / Payments demo improvements”](#e-commerce--payments-demo-improvements)

This is a series of updates designed to make it easier to build a functional end-to-end application on top of the e-commerce demo.

* Added a `ProductConfiguration` model to attach additional metadata to products.
* E-Commerce product URLs and views now use the `ProductConfiguration` `slug` field instead of the Stripe Product IDs.
* Added a `@product_required` decorator that can be used to restrict access to views based on whether the user has purchased a product.
* Added a demo “access product” page that shows how to use the `@product_required` decorator.
* Added `user_owns_product` and `get_valid_user_purchase` helper functions.
* Improved the navigation and use of breadcrumbs in the demo UI.
* **See upgrade notes for information about migrating previous data to the new set up.**

See also: the updated [Payments docs](/payments).

### Other Changes

[Section titled “Other Changes”](#other-changes-1)

#### Added

[Section titled “Added”](#added-1)

* **Added `django-htmx` and `django-template-partials` as first-class dependencies to HTMX builds.** These libraries are used by the CLI and will be used for more HTMX-based functionality moving forwards.
* Added `make manage` command to run arbitrary `manage.py` commands in a docker environment. E.g. `make manage ARGS='createsuperuser'`.
* Added the ability to pass arguments to `make test` in docker. E.g. `make tests ARGS='apps.teams --keepdb'`. (Thanks David for the suggestion!)

#### Changed

[Section titled “Changed”](#changed-2)

* Changed links on the tailwind signup page to use `pg-link` class instead of explict tailwind classes. (Thanks Peter for the suggestion!)
* Silenced extraneous djstripe warnings when running tests. (Thanks Chris for the suggestion!)
* Added `.vscode` and vs workspace files to the project `.gitignore`.
* Switched from `assert` statements to `raise ValueError` in the e-commerce Stripe checkout confirmation view.
* Moved some of the currency helper functions out of the `subscriptions` app into `utils.billing` so they can be used in ecommerce workflows even if subscriptions are disabled.
* Set `PYTHONUNBUFFERED` and `PYTHONDONTWRITEBYTECODE` in docker compose file for python containers. (Thanks Richard for the suggestion!)
* Upgraded Django to 5.1.1.

#### Fixed

[Section titled “Fixed”](#fixed-2)

* Fixed a typo in the help text for the `bootstrap_ecommerce` command.
* Fixed a bug where `user_teams` context processor could cause a crash if auth middeware didn’t run (for example, on a 500 error page in production).

### Upgrade Notes

[Section titled “Upgrade Notes”](#upgrade-notes)

If you have existing `Purchase` data in your application you will need to migrate it to the new `ProductConfiguration` structure.

This is a three-step process:

First you will need to apply the database updates, but allow `Purchase.product_configuration` to be null. Instead of running `./manage.py migrate` you will have to run the following command:

```bash
./manage.py migrate ecommerce 0002
```

After running this, you can run the following command to migrate the existing data:

```bash
./manage.py migrate_ecommerce
```

The `migrate_ecommerce` management command will:

1. Create `ProductConfiguration` objects for all products in `settings.ACTIVE_ECOMMERCE_PRODUCT_IDS`
2. Create `ProductConfiguration` objects for all products referenced in existing `Purchase` models.
3. Set `purchase.product_configuration` to the new `ProductConfiguration` object for each `Purchase`.

Finally, you can make the `Purchase.product_configuration` field non-null, by running:

```bash
./manage.py migrate ecommerce 0003
```

**New projects, or projects without any existing purchase data can skip these steps and run `./manage.py migrate` directly.** However, you may still want to run `./manage.py migrate_ecommerce` to populate `ProductConfiguration` objects for your active products.

*Sep 17, 2024*

## Version 2024.8.2

[Section titled “Version 2024.8.2”](#version-202482)

This is a maintenance release that includes a number of mostly small fixes and updates, and updates Django to version 5.1.

### Fixed

[Section titled “Fixed”](#fixed-3)

* **Fixed a few styling issues on Bulma builds**:

  * Disabled dark mode. The styling for Dark mode was not fully supported by Bulma and led to strange-looking layouts.
  * Fixed an issue where the active tab wasn’t properly highlighted in certain cases on Bulma builds.

* Fixed an issue with sqlite builds where the default `DATABASE_URL` would cause the DB to switch to Postgres. (Thanks Harry and Richard for reporting!)

* Switched allauth from [Twitter](https://docs.allauth.org/en/latest/socialaccount/providers/twitter.html) (which seems no longer supported) to [Twitter Oauth2](https://docs.allauth.org/en/latest/socialaccount/providers/twitter_oauth2.html), which still works. (Thanks Bandi for reporting!)

* Fixed an issue introduced in version 2024.8 which caused Heroku Docker deploys to fail. Heroku [does not support caching](https://stackoverflow.com/a/78901250/8207), so it has been removed from Heroku Docker builds. (Thanks Richard for reporting!)

* Fixed a bug where the `team_nav_items.html` and `team_selector.html` templates could be accidentally included even if you built without teams.

* Changed the (unused) `text-muted` css class to `pg-text-muted` in a handful of places on Tailwind builds. (Thanks Peter for reporting!)

* Removed unused `AWS_S3_CUSTOM_DOMAIN` variable from `.env` files.

### Changed

[Section titled “Changed”](#changed-3)

* **Upgraded Django to version 5.1.**
* Upgraded all Python packages to their latest versions.
* Updated Pegasus color CSS variables to use the DaisyUI variables, so that they change when you change DaisyUI themes. (Thanks Peter for the suggestion!)
* Removed `custom.mk` if your project was not generated with a `Makefile`. (Thanks Finbar for reporting!)
* Removed “Containers started” message from `make start` command that never executed. (Thanks Richard for reporting!)
* Better style inputs of type `time` and `datetime-local` in forms on all CSS frameworks. (Thanks Peter for reporting and fixing!)
* Simplified Bulma navbar to use bulma native classes instead of custom CSS. (See upgrade note below.)
* Updated default Github repo in `app-spec.yml` to use raw project slug instead of the hyphenated version. (Digital Ocean deployments, only, thanks Richard for suggesting)
* Moved `SERVER_EMAIL` and `DEFAULT_FROM_EMAIL` from `settings_production.py` to main `settings.py` file, and made it possible to set them via the environment/`.env` file.
* Added many more common settings and secrets to the Kamal `deploy.yml` file.

### Documentation

[Section titled “Documentation”](#documentation)

* Improved the documentation on [customizing the Material Bootstrap theme](/css/material).
* Added documentation for [deploying multiple apps to the same VPS with Kamal](/deployment/kamal/#cookbooks).

### Upgrading

[Section titled “Upgrading”](#upgrading-2)

* Bulma builds may need to add the `is-tab` class to `navbar-items` in the top nav to mimic the updated navbar styling.

*August 23, 2024*

## Version 2024.8.1

[Section titled “Version 2024.8.1”](#version-202481)

This is a maintenance release which upgrades HTMX to version 2.0 and fixes a handful of minor bugs.

### Changed

[Section titled “Changed”](#changed-4)

* **Upgraded HTMX to [version 2.0](https://htmx.org/posts/2024-06-17-htmx-2-0-0-is-released/).** See upgrade note below.

### Fixed

[Section titled “Fixed”](#fixed-4)

* Fixed a bug on some environments where `make build-api-client` would wrong relative to the wrong directory. (Thanks Ben for finding and fixing!)
* Downgraded Postgres from 16 to 14 on Digital Ocean deployments, due to [an issue with permissions on version 16](https://www.digitalocean.com/community/questions/how-can-i-create-a-postgres-16-user-that-has-permission-to-create-tables-on-an-app-platform-dev-database) that was causing new Digital Ocean deployments to fail. (Thanks Panagiotis for reporting!)
* Switched the default celery pool to [solo](https://docs.celeryq.dev/en/stable/internals/reference/celery.concurrency.solo.html) in development, to fix issues running on Windows. See [updated docs](/celery).
* Updated in-app help hint to recommend running `./manage.py bootstrap_ecommerce` instead of `./manage.py djstripe_sync_models price`.

### Upgrading

[Section titled “Upgrading”](#upgrading-3)

Htmx 2.0 requires loading new extensions. If you were loading HTMX extensions in your own templates, you will have to upgrade the location of those to the 2.0 versions.

Before:

```html
<script src="https://unpkg.com/htmx.org/dist/ext/ws.js" defer></script>
```

After:

```html
<script src="https://unpkg.com/htmx-ext-ws@2.0.0/ws.js" defer></script>
```

*August 13, 2024*

## Version 2024.8

[Section titled “Version 2024.8”](#version-20248)

This is a maintenance release with many small updates and fixes.

### Added

[Section titled “Added”](#added-2)

* **Added test cases for subscription decorators, feature gating, and views.** These can be extended/adapted to test custom subscription logic. Also added utility functions to create test products, subscriptions and mock requests.
* Added a test that will fail if your project is missing any database migrations. [More on this concept here](https://adamj.eu/tech/2024/06/23/django-test-pending-migrations/).
* **Added an example landing page to Tailwind builds, based largely on [Scriv’s landing page](https://scriv.ai/).**
* Added `TURNSTILE_KEY` and `TURNSTILE_SECRET` to Kamal’s default secrets.
* Added a section on configuring static files to the [production checklist](/deployment/production-checklist/#check-your-static-file-setup).

### Changed

[Section titled “Changed”](#changed-5)

* **Code is now automatically formatted for all projects.** The “Autoformat code” check box has been renamed to “Enable linting and formatting” and now only controls whether `ruff` and the pre-commit hooks are included in the project download. Projects that had already enabled auto-formatting are unaffected by this change. (See upgrade notes below.)
* **The example landing pages are now used as the project’s landing page instead of being listed in the examples**. (Bulma and Tailwind builds only.)
* **Team invitation emails are now better styled, matching the same format as account emails.** (Thanks EJ for the suggestion!)
* The `EMAIL_BACKEND` setting is now configurable via an environment variable. Also, added a commented-out example of how to set email settings for a production email provider (Mailgun).
* Apt and pip packages are now cached across Docker builds, which should result in faster build times after the first build. (Thanks Tobias for the suggestion!)
* Improved the display format of “role” in the team invitation list. (thanks Andy for the suggestion!)
* Change `user/` to `YOUR_GITHUB_USERNAME/` in the Digital Ocean `app-spec.yml` file to make it more obvious that it should be edited. (Thanks Stephen for suggesting!)
* Changed the UI of social logins on the “sign in” page to match that of the “sign up” page on the Material Bootstrap theme. This makes the implementation more extensible and more consistent with other CSS frameworks.
* **Upgraded all Python packages to the latest versions.**

### Fixed

[Section titled “Fixed”](#fixed-5)

* Fixed a bug where the formatting `make` targets were still calling `black` and `isort` instead of `ruff`. `make black` is now `make ruff-format` and `make isort` is now `make ruff-lint`.
* Fixed a bug where the sign up view tests would fail in your environment if `settings.TURNSTILE_SECRET` was set. (Thanks Finbar for reporting!)
* Fixed translations on the user profile form field names.
* Removed `svg` as an option for profile picture uploads, to prevent the possibility of using it as an XSS attack vector. ([More info on this threat here](https://medium.com/@rdillon73/hacktrick-stored-xss-via-a-svg-image-3def20968d9)).
* Disable debug toolbar in tests, which fixes test failures under certain conditions.
* Bumped the Postgres version used by Digital Ocean deployments from 12 to 16. Digital Ocean has deprecated support for version 12. (Thanks Stephen for reporting!)
* Simplified how the list of social login buttons is rendered, and make social login buttons work when configuring social applications in settings (previously buttons only showed up if you configured apps in the database). See upgrade note below.

### Removed

[Section titled “Removed”](#removed-1)

* Deleted the “sticky header” html and CSS code that was only used on the example landing pages.

### Upgrade Notes

[Section titled “Upgrade Notes”](#upgrade-notes-1)

* If you had **not** been using auto-formatting until now, you should first follow the instructions for [migrating to auto-formatted code](/cookbooks/#migrating-to-auto-formatted-code) prior to upgrading to this release. Otherwise you will likely get a lot of formatting-related merge conflicts when trying to upgrade.
  * If you already enabled auto-formatting (most projects), you don’t need to do anything.
* If you had previously configured allauth social applications in the database *and* in your settings file, you may see a duplicate “Login with XXX” button on the sign up and login pages. To fix this, remove the social application from either your settings or the database.

*August, 7, 2024*

## Version 2024.6.1

[Section titled “Version 2024.6.1”](#version-202461)

This is hotfix release that addresses a few issues from yesterday’s update:

* Fix app styles accidentally being purged during the Docker build process. This caused styling on Docker-based deployments for tailwind builds. (Thanks Steve for reporting!)
* Moved channels url import to after Django initialization. This fixes an `AppRegistryNotReady` error when deploying asynchronous apps with the AI chat app enabled. (Thanks Roman for reporting!)
* Don’t create the periodic task to sync subscriptions unless per-unit billing is enabled.

*June 6, 2024*

## Version 2024.6

[Section titled “Version 2024.6”](#version-20246)

This is a feature release with a few big updates and a lot of smaller ones.

### AI model changes

[Section titled “AI model changes”](#ai-model-changes)

The library used for non-OpenAI LLMs has been changed from [`llm`](https://github.com/simonw/llm) to [`litellm`](https://docs.litellm.ai/docs/). Reasons for this change include:

* It has far fewer additional dependencies.
* It supports async APIs out of the box (for most models).
* The `llm` library is more targeted for the command line use-case, whereas `litellm` offers similar functionality as a native Python library with a cleaner API.

Litellm can still be used with all common AI models, including OpenAI, Anthropic/Claude, and local models (via ollama). For details on getting started with `litellm` see the updated [AI documentation](/ai/llms).

### Formatting and linting now use Ruff

[Section titled “Formatting and linting now use Ruff”](#formatting-and-linting-now-use-ruff)

Black and isort have been replaced with [ruff](https://github.com/astral-sh/ruff)—a Python linter/formatter that offers the same functionality as those tools but is much faster.

Additionally, Pegasus will now remove unused imports from your files automatically, both when building your project and if you have set up `pre-commit`.

This change should be a relatively seamless drop-in replacement, though you may see some new lint errors in your projects which you can choose to address.

### Spam prevention updates

[Section titled “Spam prevention updates”](#spam-prevention-updates)

There has been a dramatic increase in spam-bots over the last month. Many of these bots target seemingly-innocuous functionality like sign up and password reset forms.

This version includes a few updates to help combat these bots. First, you can now easily add [Cloudflare turnstile](https://www.cloudflare.com/products/turnstile/) to your sign up forms, which will present the user with a captcha and should help reduce bot sign-ups. See [the turnstile documentation](/configuration/#turnstile) for information on setting this up.

Additionally, the `ACCOUNT_EMAIL_UNKNOWN_ACCOUNTS` setting has been set to `False` by default. This prevents “forgot password” and “magic link” emails from being sent out to unknown accounts. It should also help reduce unnecessary email sending.

Finally, the [admin dashboard](#admin-dashboard) no longer shows users with unconfirmed email addresses if you have set `ACCOUNT_EMAIL_VERIFICATION = 'mandatory'`. This helps filter out likely bots from the report to provide clearer visibilty of people actually signing up for your app.

### Complete changelog

[Section titled “Complete changelog”](#complete-changelog)

Below is the complete set of changes in this release.

#### Added

[Section titled “Added”](#added-3)

* **Added configurable captcha support on sign up pages, using [Cloudflare turnstile](https://www.cloudflare.com/products/turnstile/).** See [the turnstile documentation](/configuration/#turnstile) for more information on setting this up. (Thanks Troy, Jacob, Robert and others for suggesting.)
* Added API views for two-factor authentication, and to change the logged-in user’s password. (Thanks Finbar for suggesting!)
* Add UI to tell users they need a verified email address prior to setting up two-factor auth.
  * Also added a `has_verified_email` helper class to the `CustomUser` model.
* Added tests for the delete team view for both team admins and members. (HTMX builds only)
* Added test for team member removal permissions.
* Add display and sort on the number of active members in the teams admin.

#### Fixed

[Section titled “Fixed”](#fixed-6)

* Fixed a bug where team names longer than 50 characters could cause a crash during sign up.
* Fixed a bug where multi-factor authentication QR codes had a dark background when dark mode was enabled (Tailwind builds only). (Thanks Artem for reporting!)
* Fixed a bug where it was possible to bypass two-factor-authentication when using the API authentication views. (Thanks Finbar for reporting and helping with the fix!)
* Fixed a bug where deleting the user’s only team while impersonating them resulted in a temporary crash. (Thanks EJ for reporting!)
* Fixed a bug where creating an API key crashed if your user’s first + last name combined to more than 40 characters. (Thanks Luc for reporting!)
* Improved the UI feedback when LLMs fail (e.g. if your API key is wrong or ollama is not running).
* Removed the `static/css` and `static/js` directories from the `.dockerignore` file so that other project files can be included in these directories. Also updated the production Docker build process so that any existing files are overwritten by the built versions. (Thanks Raul for reporting!)
* Made some performance improvements to the production Dockerfile build (don’t rebuild the front end if there are no changes in the dependent files).
* Better support trialing subscriptions with no payment methods. The subscription UI will now show the date the trial ends and won’t log errors about missing invoices. (Thanks Jarrett for reporting!)

#### Changed

[Section titled “Changed”](#changed-6)

* **Upgraded all Python packages to the latest versions.**

* **Upgraded all JavaScript packages to the latest versions.**

* **Non-OpenAI builds now use `litellm` instead of `llm`.** See above. (Thanks Sarthak for the suggestion!)

* **Changed the formatter/linter from `black` and `isort` to [ruff](https://github.com/astral-sh/ruff).** See above.

  * Also addressed a handful of minor linting errors that came up as a result of this change.
  * Codebase linting is now substantially faster.
  * Unused imports are now automatically removed when building your projects.

* **Celerybeat now uses the `django-celery-beat` library to store tasks in the database instead of on the filesystem.** This improves support for celerybeat on Docker-based platforms. (Thanks Peter and Artem for the suggestion!)
  * Also added a migration to save the default scheduled tasks in the database.

* The login API response has changed, to allow for two-factor auth prompts, and more machine-readable status fields.

* Removed the no-longer-used `use_json_field=True` argument from wagtail `StreamField`s.

* The admin dashboard no longer shows users with unconfirmed email addresses if you have set `ACCOUNT_EMAIL_VERIFICATION = 'mandatory'`.

* The admin dashboard now includes sign ups from the current date, by default.

* Changed behavior when team role checks fail from raising a `TeamPermissionError` to returning a 403 response, and updated affected tests. One side effect of this is that the stack traces are removed from successful test runs.

* Secret keys should no longer change every time you build your Pegasus project. They are also now clearly prefixed with `django-insecure-` to indicate that they should be changed in production.

* Updated the default OpenAI chat model to gpt-4o.

* Upgraded the openapi client generator to version 7.5.0 and also pinned the version used by `make build-api-client` to the same one.

* Team IDs are now optional on the create team page (HTMX builds only).

* Add clearer error message when charts are broken due to api config issue. (Thanks Yngve for reporting!)

* Added `assume_scheme="https"` to form `URLField`s to be compatible with Django 6 behavior.

* Added `FORMS_URLFIELD_ASSUME_HTTPS = True` to be compatible with Django 6 behavior.

* Set `ACCOUNT_EMAIL_UNKNOWN_ACCOUNTS = False` by default, so that “forgot password” emails do not get sent to unknown accounts. This can help prevent spam bots.

#### Removed

[Section titled “Removed”](#removed-2)

* Removed `black` and `isort` from dev-requirements, since they have been replaced by `ruff`.
* Removed `llm` library and associated code, since it has been replaced by `litellm`.
* Removed no longer used `TeamPermissionError` class.

#### Standalone front end

[Section titled “Standalone front end”](#standalone-front-end)

The following changes affect the experimental [standalone front end](/experimental/react-front-end):

* **The standalone React front end now supports two-factor-authentication.**
* Improve the UI when you have login issues in the standalone React front end.

*June 5, 2024*

## Version 2024.5.3

[Section titled “Version 2024.5.3”](#version-202453)

This is a hotfix release that fixes a bug where the landing and dashboard page image was accidentally removed if you built without the examples enabled.

*May 21, 2024*

## Version 2024.5.2

[Section titled “Version 2024.5.2”](#version-202452)

This is a hotfix release that fixes a bug that prevented the team management page from loading in certain browsers if you built with a React front end and with translations enabled. Thanks Finbar for reporting!

* Added `defer` keyword to various bundle scripts so they are loaded after the JavaScript translation catalog.
* Updated references to `SiteJS` to run on the `DOMContentLoaded` event to allow for usage of the `defer` tag.

*May 16, 2024*

## Version 2024.5.1

[Section titled “Version 2024.5.1”](#version-202451)

This is a hotfix release that fixes issues running the [experimental React frontend](/experimental/react-front-end) in Docker. Thanks Mohamed for reporting this!

* Fix `api-client` path in the frontend docker container and add to `optimizeDeps` in vite config.
* Mount `node_modules` as an anonymous volume in the frontend docker container, so it is not overwritten.
* Automatically create `./frontend/.env` when running `make init` if it doesn’t exist.

*May 14, 2024*

## Version 2024.5

[Section titled “Version 2024.5”](#version-20245)

This is a major release with several big updates. Here are a few highlights:

### New AI models

[Section titled “New AI models”](#new-ai-models)

In addition to using OpenAI chat models, you can now build the Pegasus AI chat applicaiton with the [`llm` library](https://github.com/simonw/llm). This lets you run the chat application against any supported model—including the Anthropic family (Claude 3), and local models like Llama 3.

Additionally, the image generation demo now supports Dall-E-3 and Stable Diffusion 3. For complete details, see the new [AI documentation](/ai/images).

### Health Checks

[Section titled “Health Checks”](#health-checks)

A new setting allows you to turn on health checks for your application, powered by [django-health-check](https://django-health-check.readthedocs.io/en/latest/). This will create an endpoint (at `/health` by default) that pings your database, Redis instance, and Celery workers and returns a non-200 response code if there are any identified issues.

These endpoints can be connected to a monitoring tool like [StatusCake](https://www.statuscake.com/) or [Uptime Robot](https://uptimerobot.com/) so that you can be alerted whenever your site is having issues.

See the section on [monitoring](/deployment/production-checklist/#set-up-monitoring) in the production checklist for more information.

### Allauth updates

[Section titled “Allauth updates”](#allauth-updates)

The [django-allauth](https://docs.allauth.org/en/latest/) library was updated to the latest version, which enabled several useful changes.

The first is a “sign in by email code” option which can be used in addition to the standard username/password and social option. Users can request a code be sent to their registered email and can then use that to login. See [the magic code documentation](/configuration/#enabling-sign-in-by-email-code) to enable/disable this.

The second is using the recent [multi-factor authentication](https://docs.allauth.org/en/latest/mfa/index.html) support added to allauth in favor of the third-party `django-allauth-2fa` library. This reduces dependencies and puts all of authentication functionality on a standard path moving forwards.

The complete release notes are below:

### Added

[Section titled “Added”](#added-4)

* **Added an optional health check endpoint at /health/.** (see above for details)
* **Added an option to connect the chatbot to other LLMs**. (see above for details)
* **The AI image generation now supports Dall-E 3 and Stability AI.**
* **All generated projects now include a `LICENSE.md` file.** The goal of the license file is not to change how Pegasus can be used in any way, but rather to document those terms in the codebase itself (previously they were only documented on the [terms page](https://www.saaspegasus.com/terms/)). For more information you can see the new [license page](https://www.saaspegasus.com/license/).
* **Added support for “magic-code login”, where a user can login to the site by requesting a code to their email address.** [Documentation.](/configuration/#enabling-sign-in-by-email-code)
* **Google cloud run builds now support Redis.** For details, see the [updated documentation](/deployment/google-cloud). (Thanks Forrest for suggesting!)
* Added a `custom.mk` file where you can add additional `make` targets without worrying about future Pegasus upgrades. (Thanks John for proposing this!)

### Changed

[Section titled “Changed”](#changed-7)

* Upgraded allauth to the latest version (0.62.1).
* **Migrated two-factor authentication from the third-party `django-allauth-2fa` to the `django-allauth` built-in implementation.** See upgrade notes below for migrating existing projects.
* Refactored how many allauth views work to be compatible with their new template override system.
* **Bootstrap and Bulma builds: Move sidebar navigation into the mobile menu instead of having it take up the top of the screen on mobile screens**, similar to how things already worked on Tailwind and Material. (Thanks Luc for the nudge!)
  * This includes splitting out the menu items into their own sub-template files so they can be included in both menus.
* Inline buttons are now spaced using the `gap` CSS property instead of the `pg-ml` class on individual buttons.
* `Alpine.start()` is now called on `DOMContentLoaded` loaded event instead of using `window.load`. This makes Alpine-powered UIs more responsive, especially when used on pages with lots of images.
* **Updated external JavaScript imports to use [the `defer` keyword](https://www.w3schools.com/tags/att_script_defer.asp) for slightly better page load performance.** (See upgrade note.)
  * Also updated inline JavaScript code in a handful of places to be compatible with deferred scripts.
* Added a Github logo to connected Github accounts on profile page.
* **The AI image demo and code has been moved to a first-class Pegasus application / tab.**
* Update the docker container registry used by Google Cloud to reflect the latest version in Google. Also push more Google Cloud configuration variables out of the Makefile and into the environment variables. (Thanks Erwin for reporting!)
* Added additional `.env` files to `.dockerignore` for Google Cloud builds.
* Bumped django to the latest `5.0.6` release.

### Fixed

[Section titled “Fixed”](#fixed-7)

* **SQLite build now properly parse `DATABASE_URL` if it is set. This fixes issues deploying to certain platforms when building with SQLite.** (Thanks Manasvini for reporting!)
* Updated allauth documentation links in the README to point to the new [allauth docs site](https://docs.allauth.org/). (Thanks Shantu for reporting!)

### Removed

[Section titled “Removed”](#removed-3)

* Removed several no-longer-needed allauth template files.
* Removed deprecated “version” field from the dev `docker-compose.yml` file. (Thanks Moyi for reporting!)
* Removed no-longer-used `pg-ml` css spacing class.
* Removed redundant type=“text/javascript” declarations from a few `<script>` tags.
* Removed unused HTMX script import from employee app demo page.
* Removed the no-longer-used `openai_example` app (functionality has been moved to `apps.chat` and `apps.ai_images`).
* Removed the no-longer-needed `AccountAdapter` class. This class was previously used to add two-factor support to login, which is now handled natively by allauth.

### Upgrading

[Section titled “Upgrading”](#upgrading-4)

**Two-factor authentication**

If you are using two-factor authentication you must run:

```bash
python manage.py migrate_allauth_2fa
```

Which will bring across existing device set ups and recovery codes. **If you don’t do this, you will remove two-factor-authentication configuration for all users who have set it up, compromising their security.**

**JavaScript defer changes**

The change of adding the `defer` keyword to `<script>` imports could have unintended consequences if you were relying on functions / functionality in your scripts being available on page load. This would most likely manifest as a browser JavaScript error of the form: `Uncaught ReferenceError: htmx/SiteJS/etc. is not defined`.

To resolve this, make sure all additional dependencies are also loaded with `defer` (for external scripts), or only referenced after the `'DOMContentLoaded'` event (for inline scripts). Alternatively, you can remove the `defer` keyword from the `<script>` tags in `base.html` or affected templates to restore the previous behavior.

*May 9, 2024*

## Version 2024.4.2

[Section titled “Version 2024.4.2”](#version-202442)

This is a maintenance release with a number of fixes and small changes. The most notable change is that the OpenAI chat example is now fully asynchronous.

### Added

[Section titled “Added”](#added-5)

* **Kamal deployments now support celerybeat for scheduled tasks out-of-the-box.** (Thanks Peter for the suggestion!)
* Added an example celerybeat configuration to the built-in examples.

### Changed

[Section titled “Changed”](#changed-8)

* **The websocket OpenAI chat example is now fully asynchronous.** This should substantially improve the number of concurrent sessions supported by the app.
* Use alpine to disable submit and clear input in the OpenAI chat example (thanks Artem for the suggestion!)
* Renamed “OpenAI Demos” tab to “AI Demos”.
* Renamed `get_chatgpt_response` task to `get_chat_response`.
* Change the default admin ordering for Users to date joined, descending.
* Google cloud builds only: `.env.production` is no longer included in Pegasus builds, since it was ignored by git. Instead `.env.production.example` is included. (Thanks Naveed for reporting!)
* Attach Stripe Customer to User/Team in `provision_subscription` function instead of the view, which makes it work in webhook processing as well.

### Fixed

[Section titled “Fixed”](#fixed-8)

* **Fixed a bug where non-admins of teams could not view their own team settings/members.** (Thanks Bernard for reporting!)
* Fixed a bug where deleted subscriptions with `canceled_at_period_end=True` could cause a crash when trying to view them. This bug would typically only manifest in test mode or if you manually deleted subscriptions in Stripe.
* Fixed a crash when looking up the currency for a deleted subscription.
* Added a constraint to the `Membership` model to disallow users being “added” to a team more than once. (Thanks Zac for reporting!)
* Fix typo instructing you to “comment out” mailgun settings instead of “uncomment” them. (Thanks Adam for reporting!)
* Google cloud builds only: added `--platform linux/amd64` to the `gcp-build` make target, to address [build/deploy issues from Mac M2s](https://stackoverflow.com/a/68766137/8207). (Thanks Naveed for reporting!)

### Documentation

[Section titled “Documentation”](#documentation-1)

* Improved the [instructions for running Kamal with Docker](https://docs.saaspegasus.com/deployment/kamal/#running-kamal-with-docker). Thanks EJ and Simon for the help with this!

*April 22, 2024*

## Version 2024.4.1

[Section titled “Version 2024.4.1”](#version-202441)

This is a hotfix/security release that fixes an issue where the `deploy/.env` file was not properly ignored by the `.dockerignore` when using Kamal deployment. This resulted in credentials being included in built Docker containers.

You are affected if you:

1. Deployed your application with Kamal.
2. Made your built Docker image publicly available.

If this is the case it is recommended to immediately upgrade and cycle any credentials that were listed in `deploy/.env`. Sorry about the inconvenience! Thanks to Denis for reporting and to Erwin for pointing out the security implications.

Note: if you’d like to patch this issue without upgrading, you can replace `.env` in your `.dockerignore` file with `**/.env`.

*Apr 17, 2024*

## Version 2024.4

[Section titled “Version 2024.4”](#version-20244)

There are two major updates in this release, a new websocket-based streaming chat UI, and upgrading Bulma to version 1.0.

### Streaming Chat UI

[Section titled “Streaming Chat UI”](#streaming-chat-ui)

The OpenAI Chat demo now streams responses in real time. This provides a much better user experience for chat applications, as the user doesn’t stare at a “loading” screen for a long time waiting for the complete response.

This feature is currently only supported on HTMX builds. It will be automatically enabled if you enable the “asynchronous” build option. If you do not enable async you will still be able to use the old UI.

You can watch a demo of this and learn how it’s built in this video: [Building a ChatGPT clone with Django, Channels, and HTMX](https://www.youtube.com/watch?v=8JSiiPW4S0A).

### Bulma upgrade to 1.0

[Section titled “Bulma upgrade to 1.0”](#bulma-upgrade-to-10)

[Bulma 1.0](https://github.com/jgthms/bulma/releases/tag/1.0.0) was released in late March and Pegasus has been updated to support it. The UI will change slightly but there should not be any breaking or substantial changes as a result of this upgrade. See details below.

### New

[Section titled “New”](#new)

* **OpenAI Chat demo now supports streaming responses.** This is only turned n for HTMX builds with asynchronous support enabled. Big thanks to Artem for the implementation support!

### Updated

[Section titled “Updated”](#updated-1)

* **Upgraded Bulma to 1.0.** Related changes (bulma builds only):

  * Switched all variables from Sass variables to CSS variables.
  * Updated syntax of all responsive CSS to use `@include mixins` instead of `+from`, `+until`, etc.
  * Switched how bulma is initialized from `@import` to `@use`.
  * Removed some unnecessary variable declarations from `site-bulma.scss`

* **Upgraded other JavaScript packages to their latest versions.**

* Upgraded Django to 5.0.4

### Fixed

[Section titled “Fixed”](#fixed-9)

* Fixed a bug where the standalone front end Dockerfile did not install the right dependencies. In some cases, this caused the front end to not start properly.
* Fixed a bug where viewing a non-existent team would cause a 500 error instead of a 404.
* Removed some unused code in the OpenAI chat example if you were building with React.

*April 5, 2024*

## Version 2024.3

[Section titled “Version 2024.3”](#version-20243)

This is a big feature release! The main goal of the release is to make it easier to use Pegasus with separate front ends and mobile applications. Here are the highlights:

### API Authentication and JWT support

[Section titled “API Authentication and JWT support”](#api-authentication-and-jwt-support)

Pegasus now optionally includes API endpoints for registering, authenticating and verifying users (via JSON web tokens or JWT). This provides all the pieces needed to make your Pegasus application a backend to a standalone front end, for example a React or Next.js SPA, or a mobile application.

You can read more about this feature in the [Authentication API documentation](/apis/#authentication-apis).

### Standalone React (Vite) Front End (Experimental)

[Section titled “Standalone React (Vite) Front End (Experimental)”](#standalone-react-vite-front-end-experimental)

In addition to the authentication API support, Pegasus now includes an optional standalone React demo application built with React, [Vite](https://vitejs.dev/) and [React Router](https://reactrouter.com/en/main).

The demo application includes sign up and login workflows, helper components to manage authentication and protected routes, and a port of the employee demo application (using the same code as the Pegasus version).

You can watch a demo below and learn more about it in [the React front end documentation](/experimental/react-front-end).

### Teams Navigation Updates

[Section titled “Teams Navigation Updates”](#teams-navigation-updates)

Application navigation now uses a new team selector component. This allows users to quickly see their team list and switch between teams directly from any page. Team management has also been moved under this component, and the previous team section of the navigation was removed.

### Complete release notes

[Section titled “Complete release notes”](#complete-release-notes)

#### Added

[Section titled “Added”](#added-6)

* **API Authentication and JWT support.** See above.
* **An Experimental Standalone React (Vite) Front End**. See above.

#### Changed

[Section titled “Changed”](#changed-9)

* **Team navigation overhaul**. See above.

* **Made changes to the Employee demo app to support being shared with the standalone front end.**

  * Move `BrowserRouter` declaration outside the `EmployeeApplication` component so the routes can be used in different routers.
  * Change all `Link` and `Route` declarations in `EmployeeApplication` to be relative paths instead of absolute.
  * Pass image references into the app as props instead of relying on an externally defined constant (`STATIC_FILES`). This allows the application to be served from multiple URL endpoints without modification.
  * Pass `urlBase` to the nested components, so that they can route back to different paths (e.g. when employees are saved).
  * Switch the department choice field from a passed-in `EMPLOYEE_DEPARTMENT_CHOICES` data structure to the `DepartmentEnum` object that is included with the API client.
  * Change file extension for several components from `.js` to `.jsx`.

* **Made changes to the JavaScript api client to support being shared with the standalone front end**

  * **Moved the api-client from `assets/javascript/api-client` to an `api-client` folder in the root of the repository.**
  * **The api client is now installed as a linked local dependency in `package.json` instead of referenced as part of the code.** This makes it easier to move the api client code or install it as a hosted npm package. Also updated all references to the api-client to reflect this change.
  * Renamed the `api-client` make target to `build-api-client` to avoid conflicting with the filesystem folder.
  * **The API client is now built dynamically, just in time, when you create your project. Also updated the API client version to 7.4.0.** This may result in slight differences in generated API client code, but the resulting code should be *more* correct and there should not be any breaking changes to existing Pegasus functionality.

* Be more explicit in the webpack config about using babel-loader presets instead of relying on `babelrc`

* Exclude frontend from the base type check config in `tsconfig.json`. The front end is checked independently.

* Auto-size the navigation column in `app_home.html` (Bootstrap builds only).

* Make ALLOWED\_HOSTS configurable by environment variables in both dev and production. (Thanks Shawn for suggesting)

* **Removed `.env.docker`. Docker development environments are now managed by `.env` (same as native environments).** Also updated the documentation on this.

* Added a search input to Team admin UI.

* Added a `signup_closed.html` template which improves the styling of the “signups closed” page if you turn off public signups. (Thanks EJ for the suggestion!)

* Added an `account_inactive.html` template which improves the styling of the “inactive account” page if an inactive user tries to login. (Thanks Lauren for the suggestion!)

* Improved the contrast on help text in dark mode. (Tailwind builds only)

* Changed the main icon on the landing page and dashboard from the old rocket to the current SaaS Pegasus rocket.

* Added a “Built with SaaS Pegasus” line to the default generated footer.

* Bump Django to latest 5.0.3 release.

#### Fixed

[Section titled “Fixed”](#fixed-10)

* Fixed hard-coded reference to the Pegasus dev project in Google Cloud media configuration in `settings_production.py`
* Fixed a bug where the two-factor QR codes were very difficult to scan in dark mode. (Tailwind builds only)
* Made certain account pages (password reset, two-factor auth, etc.) darker in dark mode. (Tailwind builds only)
* Removed a redundant check for empty subscription from `view_subscription.html` (thanks Rob for reporting!)
* Fixed a bug that caused errors displaying prices in secondary currencies if they prices had decimals in them. (Thanks Matthew for reporting and the fix!)
* Fixed team signup test if you have disabled signups. (Thanks Saif for reporting and proposing the fix!)
* Fixed a bug where links to the user dashboard were accidentally missing if you disabled user impersonation. (Thanks Simon for finding!)

### Upgrade notes

[Section titled “Upgrade notes”](#upgrade-notes-2)

If you are using Docker in development you might need to move/copy your `.env.docker` file to `.env` when you update your project.

*Mar 22, 2024*

## Version 2024.2.4

[Section titled “Version 2024.2.4”](#version-202424)

This is another minor hotfix release. Details:

* Fixed Google Cloud `Makefile` targets to use the built project’s ID instead of the Pegasus development project’s ID. (Thanks Daan for reporting!)
* Minor changes to `fly.toml` to fix errors on certain environments/versions. (Thanks Denis for reporting!)

*Feb 26, 2024*

## Version 2024.2.3

[Section titled “Version 2024.2.3”](#version-202423)

This is a hotfix release that restores the `deploy/` folder that was accidentally not present on certain Google Cloud builds. *Thanks Yogesh for reporting!*

*Feb 24, 2024*

## Version 2024.2.2

[Section titled “Version 2024.2.2”](#version-202422)

This is a big Pegasus release with a new Github integration for creating and upgrading projects, as well as an overhaul of the Google Cloud deployment support and many small updates and fixes from the community.

### New Github distribution model

[Section titled “New Github distribution model”](#new-github-distribution-model)

You can now create and upgrade your projects directly on Github! This is a much smoother experience than the previous zip file model (which is still available). You can also connect an existing project to Github by following the [instructions here](/github/#connecting-an-existing-project-to-github).

For more details see the screencast below, and the updated [Getting Started](/getting-started) and [Upgrading](/upgrading) pages.

A few code changes were needed to support this workflow (in particular, it’s no longer possible to deliver files which were in the `.gitignore` file):

* Pegasus no longer ships with a `.env` or `.env.docker` file and instead these must be created from `.env.example`.
* `.env.example` will now use Docker-based URLs for your Postgres and Redis database if you build with Docker enabled.
* Added `make setup-env` command to create your `.env.docker` file from `.env.example`.
* Updated the `make init` create your `.env.docker` file if it doesn’t already exist.
* Updated the setup documentation to reflect the above changes.

### Overhauled Google Cloud Deployment

[Section titled “Overhauled Google Cloud Deployment”](#overhauled-google-cloud-deployment)

The Google Cloud deployment support has been completely overhauled and brought in line with other deployment plastforms. These are the major changes (affecting Google Cloud deployments only):

* Updated the Google Cloud set up and [setup documentation](/deployment/google-cloud) based on the latest Google guide.
* Google Cloud now uses the same Dockerfile as other deployment options.
* Google Cloud now uses whitenoise for Static files, the same as other deployment options. It still uses Google Cloud Storage for media files.
* Added `Makefile` targets for Google Cloud options for building, pushing, and deploying.
* Deleted legacy `cloudmigrate.yaml` and `cloud_run.sh` files.
* Simplified the `prod-requirements.in` file.
* Fixed a bug where uvicorn was not correctly installed in production for async builds.
* Fixed various settings to work with the latest Google Cloud guides and best practices and simplified many of the other settings.
* Updated the Django storages set up for the latest Django 4.2 / 5.0 settings.

*Big thanks to Conrad, Rob, Troy, and Nathan for helping find and work through these changes.*

### Other Fixes

[Section titled “Other Fixes”](#other-fixes-2)

* Include djstripe webhook url endpoints if building with ecommerce and not subscriptions. (Thanks Emiliano for reporting!)
* Fixed a bug where a Social App in the database for a provider that was not configured would cause a crash.
* Fixed a bug where teams tests would fail if `ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE` was enabled. (thanks Saif for reporting and the fix!)
* Fixed a bug where social button icons would not work with manifest file storage.

### Other Changes

[Section titled “Other Changes”](#other-changes-2)

* Updated most `make` targets that run commands in Docker to not require the `web` container to be running. They will now spin up and remove temporary containers instead. (Thanks Artem for the suggestion!)
* Slightly improve styling of page that shows when there are social authentication errors (thanks Finbar for the contribution!)
* Make `USE_HTTPS_IN_ABSOLUTE_URLS` setting configurable via an environment variable.
* (Render only) Make the casing of booleans in `render.yaml` consistent.
* (Kamal only) Added more environment variable declarations to the default Kamal setup.
* (fly.io only) Overhauled the `fly.toml` deployment file to be consistent with fly’s latest format and removed unnecessary parts.
* (Bulma only) updated the sign up form so that the password(s) come before the team name to be consistent with other CSS frameworks.
* (Bulma only) allow changing the email address you sign up from when accepting a team invitation.

### Documentation updates

[Section titled “Documentation updates”](#documentation-updates)

* Overhauled [Google Cloud setup docs](/deployment/google-cloud).
* Added Github instructions to [upgrading documentation](/upgrading).
* Added Github instructions to [getting started](/getting-started).

*Feb 21, 2024*

## Version 2024.2.1

[Section titled “Version 2024.2.1”](#version-202421)

This release fixes the OpenAI demo to be compatible with the latest Python library:

* Fix ChatGPT example to work with latest OpenAI API.
* Fix Dall-E example to work with latest OpenAI API.
* Update a Github action to latest version that was missed in the last release.

*Feb 5, 2024*

## Version 2024.2

[Section titled “Version 2024.2”](#version-20242)

This release adds Django 5.0 support, upgrades all dependencies to their latest versions, and includes a handful of other changes.

Details:

* **Support Django 5.0.** Django 4.2 LTS should also work, but 5.0 will be the default version tested and used moving forwards.
* **Upgraded all Python dependencies to their latest versions.**
* **Upgraded all JavaScript dependencies to their latest versions.**
* Upgraded all Github actions to use latest versions.
* Simplified the process for building the front end API client with Docker (thanks Finbar for the pointer!). [Api client docs](/apis/#generating-the-api-client) have been updated as well.
* Update links to all Django documentation to link to the latest stable release, instead of a specific version.
* Fixed a schema warning for the user signups dashboard API.
* Update link to the guide to celery progress bars to the new blog post url.
* Simplified the process of setting up your ecommerce config to a new management command: `./manage.py bootstrap_ecommerce`.
  * Also refactored related code to be shared between ecommerce and subscriptions.
* Added `subscription_is_active` helper function, to remove duplicate code that was running the same check. Also updated [the documentation](/payments/#set-up-your-development-environment).
* Fixed a bug where if you marked a subscription to be canceled at the period end and weren’t running webhooks, the subscription page would crash.
* Added `staff_member_required` decorator to all superuser-only views, to ensure that the user is also active, and staff. (Thanks Felipe for the suggestion!)
* Removed `tailwindcss/forms` plugin, which conflicted with some default DaisyUI form elements and wasn’t needed. (thanks Artem and Alex for the suggestion!)
* Added better styling for the socialaccount connections page. (thanks Finbar for the contribution!)

*Feb 2, 2024*

## Version 2024.1.2

[Section titled “Version 2024.1.2”](#version-202412-1)

This is a minor/hotfix release that fixes a few issues related to fly.io deployments due to changes in the default values used by fly. It also updates the [fly documentation](/deployment/fly) to use the latest `flyctl` workflow for launching new applications.

*Thanks to Naveed for reporting this.*

*January 15, 2024*

## Version 2024.1.1

[Section titled “Version 2024.1.1”](#version-202411-1)

This is a minor/hotfix release that disables self-hosting media files with Kamal deployment, since this wasn’t working well for production environments.

For now it is recommended to use S3 to host media files with Kamal, though this may change in the future.

To get the hotfix without upgrading you can just remove these two lines from your `deploy.yml` file:

```yaml
volumes:
  - "{your-app-slug}-media:/code/media"
```

*January 9, 2024*

## Version 2024.1

[Section titled “Version 2024.1”](#version-20241)

This is a minor/hotfix release with some small updates/fixes to the group chat UI and Kamal deployment:

* Fixes an issue where there were missing templates if you installed with asynchronous support and without OpenAI. (Thanks Jose for reporting!)
* Chat templates have now been moved to `web/chat` so it is clear they can be re-used across apps.
* Added tests that would have caught the above issue.
* Renamed `TestLoginRequiredView` to `TestProfileViews` to be more clear what it is doing.
* Bumped Django to the latest 4.2.9 bugfix release.
* Don’t run Celery with gevent in Kamal deployments, since it is not necessary and not always installed. (Thanks Luis for reporting!)
* Use `settings_production` in Kamal deployments by default, instead of requiring manually setting the environment variable. (Thanks Luis for reporting!)

*January 3, 2024*

## Version 2023.12.1

[Section titled “Version 2023.12.1”](#version-2023121)

This hotfix release changes the `multiarch` value in Kamal deploys to `true`, which fixes errors when deploying from Mac / Windows machines to Linux servers (thanks Luis for reporting). There was also an overhaul of the [Kamal docs](/deployment/kamal).

If you want the hotfix without upgrading, you can just set `multiarch: true` in the `builder` section of your `deploy.yml` file.

*December 20, 2023*

## Version 2023.12

[Section titled “Version 2023.12”](#version-202312)

The big update in this release is official support for deploying Pegasus apps onto any linux server. This allows you to deploy Pegasus apps onto any VPS, like Linodes, Digital Ocean Droplets, or Amazon EC2 / Lightsail instances. The deployment uses Docker containers, managed using [Kamal](https://kamal-deploy.org/). You can deploy your entire application onto a single server (the default), multiple servers, or mix-and-match between self-hosted and managed services (e.g. Amazon RDS) with an easily customizable configuration.

For more details, see the new [Pegasus Kamal documentation](/deployment/kamal).

Below are the complete release notes:

### Added

[Section titled “Added”](#added-7)

* **Added support for deploying to any linux server using the new Kamal deployment option. [Documentation](/deployment/kamal).**
* **Added first-class support for “login with Github.”**
* Added a basic `.dockerignore` file.
* Added an optional argument to `make npm-install` for installing individual packages, and added a `make npm-uninstall` target for uninstalling packages. (Thanks Gary for the suggestion/contribution!)

### Changed

[Section titled “Changed”](#changed-10)

* **Load `request.team` in `TeamsMiddleware` even if the user doesn’t have access to the team if `team_slug` is passed to the view. Since authorization is done in the view decorators like `login_and_team_required` this should be safe, and makes it easier to create team views that don’t require authentication.**
  * Also updated tests to reflect this new behavior.
* Only show social apps which have been created in the database on the sign up and login pages, and clean up/standardize how social app code/buttons are added.
  * Also switch social logins to use POST and remove `SOCIALACCOUNT_LOGIN_ON_GET = True` from settings.
* **Add a `customer` object to the `CustomUser` model when ecommerce is enabled, and re-use the same customers when a user makes multiple purchases.**
* Silence `dj-stripe` warning about Stripe keys being kept in settings. This is standard practice for Pegasus applications.
* Mock out JavaScript translations and remove translation-based views when building without translations enabled. This should slightly improve page-load times when not using translations.
* Explicitly set `DEBUG=False` in the Render production environment.
* Explicitly set default region on fly.io deployments.
* Changed postgres connection strings from `postgres://` to `postgresql://`. Either one works in Django, but only the latter works with sqlalchemy, so using it allows the same connection string to be used with both tools.
* **Upgraded everything to run Node 20 instead of Node 18.**
* **Upgraded the base Docker images from bullseye (Debian 11) to bookworm (Debian 12).**
* **Overhauled the production Docker setup to use a [multi-stage build](https://docs.docker.com/build/guide/multi-stage/). This should allow for faster build times (partial builds can run in parallel) as well as faster rebuild time, as more steps are able to be cached more often.**
* Profile picture media files are now deleted when the associated user is deleted.
* Default the `PORT` variable used by django in production deployments to `8000` if not specified in the environment.
* Changed django database engine from `django.db.backends.postgresql_psycopg2` to `django.db.backends.postgresql` (these behave the same, but the latter is now recommended).

### Fixed

[Section titled “Fixed”](#fixed-11)

* Fixed description of `dev-requirements.txt` to indicate it installs development, not production requirements. (Thanks Yngve for reporting!)
* Fixed 500 error when trying to accept an invitation that was already accepted.
* Removed duplicate DB lookups on invitation acceptance page.
* Set avatar image filenames to be randomly generated. This fixes an issue where, under certain media configurations, uploaded profile pictures with the same filename could “clobber” each other.
* Fix test failures when manifest storage was configured, by overriding the `STORAGES` setting in affected tests.
* Fixed 500 error when attempting to manage social app connections from the profile page, due to extending a deleted `allauth` template.
* Attempt to add more `INTERNAL_IPS` to `settings.py` when using Docker in development, to get Django debug toolbar to show up. (Thanks Artem for reporting/contributing!)
* Fixed issue with missing `$PORT` reference caused fly.io deployments to sometimes fail.

### Removed

[Section titled “Removed”](#removed-4)

* Removed migration to auto-create social apps in the database.
* Cleaned up template imports in a few places.

### Upgrade notes

[Section titled “Upgrade notes”](#upgrade-notes-3)

The `TeamsMiddleware` change may change the access rules of views that were relying on the absence of `request.team`, to control authorization, instead of using `login_and_team_required` or similar approaches.

The removed migration file (`/web/migrations/0002_create_allauth_providers.py`) should not be removed if you have already run the migration on your environment. Keeping it in the repository won’t do any harm.

*December 12, 2023*

## Version 2023.11.1

[Section titled “Version 2023.11.1”](#version-2023111)

This is a hotfix release that fixes an issue with calling dj-stripe’s `get_subscriber_model` utility when teams were enabled by adding an `email` property to the `Team` object. The `email` property was accidentally not added for certain build configurations.

You can manually apply this change by adding the following property to the `Team` model, in `apps/teams/models.py`:

```python
@property
def email(self):
    return self.membership_set.filter(role=roles.ROLE_ADMIN).first().user.email
```

Thanks to Charley and Emilien for reporting!

*Nov 10 2023*

## Version 2023.11

[Section titled “Version 2023.11”](#version-202311)

This is a hotfix release that fixes the Node.js docker installation according to [these nodesource changes](https://github.com/nodesource/distributions#new-update-%EF%B8%8F).

You can also manually apply this change by replacing the current node installation steps with the following code in your `Dockerfile.dev` and `Dockerfile.web`.

```plaintext