Version History and Release Notes ================================= Releases of [SaaS Pegasus: The Django SaaS Boilerplate](https://www.saaspegasus.com/) are documented here. ## Version 2024.4 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 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 [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 - **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 - **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 - 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 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 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.md#authentication-apis). ### 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.md).
### 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 #### Added - **API Authentication and JWT support.** See above. - **An Experimental Standalone React (Vite) Front End**. See above. #### Changed - **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 - 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 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 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 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 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 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](upgrading.md#connecting-an-existing-project-to-github). For more details see the screencast below, and the updated [Getting Started](/getting-started.md) and [Upgrading](/upgrading.md) 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 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.md) 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 - 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 - 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 - Overhauled [Google Cloud setup docs](deployment/google-cloud.md). - Added Github instructions to [upgrading documentation](upgrading.md). - Added Github instructions to [getting started](getting-started.md). *Feb 21, 2024* ## Version 2024.2.1 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 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.md#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.md#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 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.md) to use the latest `flyctl` workflow for launching new applications. *Thanks to Naveed for reporting this.* *January 15, 2024* ## Version 2024.1.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 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 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.md). 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 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 - **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 - **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 - 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 - Removed migration to auto-create social apps in the database. - Cleaned up template imports in a few places. ### Upgrade notes 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 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 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`. ``` # install node/npm RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | \ gpg --dearmor -o /usr/share/keyrings/nodesource.gpg RUN echo \ "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | \ tee /etc/apt/sources.list.d/nodesource.list && \ apt-get update && \ apt-get install nodejs -yqq ``` Thanks to Finbar on Slack for reporting and suggesting the fix! *November 1, 2023* ## Version 2023.10.1 This is a minor release addressing a few small issues raised in the `2023.10` release. - **Upgrade docker containers from `python:3.11-buster` to `python:3.11-bullseye`. This change substantially improves performance on certain Mac builds.** - Upgrade django to the latest 4.2.6 security release. - Reduce db queries on the e-commerce home page. - Don't show "buy" links on the e-commerce page if the products do not have a default price set. - Change default value of `ALLOWED_HOSTS` to `["*"]` and allow overriding it via an environment variable. - Clean up whitespace in `user_dashboard.html`. *Oct 9, 2023* ## Version 2023.10 This is a major release with three big updates: Async/Websocket support, an E-Commerce application, and an admin user dashboard. ### Async / Websocket support Pegasus now supports asynchronous Django and Websockets. Included is an example group chat application that leverages these capabilities. Watch the video below for more details, or see the new [async / websocket documentation](async.md):
### E-Commerce (One-Time Payment) Application The previous Stripe Payments example has been converted into a full-blown E-Commerce store. You can manage your products in Stripe and sync them to your application with a few lines of configuration. Customers can purchase specific items and everything is linked to your Stripe dashboard. Watch the video for more details, or see the new [E-Commerce documentation](payments.md)::
### Admin Dashboard An admin-facing dashboard has been added. The dashboard lets you see User sign ups to your application over time, and is filterable by date range. It's a useful tool to see how your app is growing, and a good launching point for building out more dashboard capabilities. Screenshot: ![Admin Dashboard](/images/user-dashboard.png) Below are the complete release notes including several other substantial changes and supporting work for the above. ### Added - **Added asynchronous and websocket support via a new build option.** [Documentation](async.md). - **Related: Added the group chat example application if you enable asynchronous support.** - Related: Added `websocket_reverse` and `websocket_absolute_url` helper functions and tests. - Related: Added `.pg-message-sender` helper CSS class. - Related: If building with async your app will use `asgi` instead of `wsgi`. - **Added the E-Commerce example application via a new build option.** [Documentation](payments.md). - **Added the admin dashboard.** - Related: Added an admin-only user signup API - Added a `pg-link` helper class to style links (especially on Tailwind and Material builds). Also applied this style to a few places. - Added basic tests for some of the example views. - Added an example of customizing existing DaisyUI themes to the [Tailwind docs](css/tailwind.md). - Added `absolute_url` template tag for generating full URLs in e.g. email templates, and added tests for it. ### Changed - **Added the `feature_gate_check` and `get_feature_gate_check` helper functions, for more fine-grained control of feature gate checking.** See the updated [feature-gating documentation](subscriptions.md#feature-gating) for more information. - Related: Modified the `active_subscription_required` decorator to use this function. - Reduced number of DB queries made when provisioning a subscription. - Made subscription provisioning an atomic action to reduce race conditions between Stripe Checkout callbacks and webhooks. - Stripe subscription webhooks now explicitly only process checkout sessions that were created by the subscriptions application. This was done to enable apps to handle both e-commerce and subscription payments, and is handled by adding (and checking) a "source" value on the checkout session metadata. - Created a `TestLoginRequiredViewBase` base test class, to test logged-in views, and updated existing tests to use it. - Removed uppercase characters from `TestLoginRequiredView` test methods. - Upgraded Chart.js to the latest version, and moved it to be installed from NPM instead of a CDN. - Changed the example charts to use the NPM-installed Chart.js. - Moved `get_stripe_module` to `apps.utils.billing` so it can be used by the e-commerce app and subscriptions. - **Upgraded `django-allauth` to latest version (0.57.0).** - Related: Added a migration to create default `SocialApp` models for all enabled providers, otherwise the signup and login pages crash. - Related: Blank out help-text on the sign up form's password input. - Related: Added `allauth.account.middleware.AccountMiddleware` to `MIDDLEWARE` - Related: Fixed links to allauth docs in the generated README file. - Upgraded Django to the latest 4.2.5 security release. - Set `DEBUG=False` when running `collectstatic` on production Docker builds. - Added some fields to the default `CustomUserSerializer`. - Added `created_at` field to chat message admin list display / list filter. - Removed some unused imports from subscription views. - Refactored chat message list into a standalone template. ### Fixed - Fixed absolute paths to Android-specific favicons to be relative. (Thanks Alexander for reporting!) - Fixed issue where mobile menu content sometimes did not appear in front of page content on Tailwind builds. - The object lifecycle home example view now requires login. - Fixed issues with calling dj-stripe's `get_subscriber_model` utility when teams were enabled, by adding an `email` property to the `Team` object, and implementing `DJSTRIPE_SUBSCRIBER_MODEL_REQUEST_CALLBACK`, and added a test case that confirms this works moving forwards. - Fix styling of date inputs on all CSS frameworks. - Fixed tab highlighting of the "impersonate a user" navigation on the Bootstrap Material theme. ### Removed - **Removed the previous Payments example.** Apps should refer to the new E-Commerce app to use one-time payments. - Related: Removed all migrations from the example app, which now has no models. - Related: Removed the previous Payments documentation. - Removed the "removing Stripe" cookbook from the documentation. Stripe is no longer included unless you build with the E-Commerce example or Subscriptions enabled. ### Upgrade Notes - To migrate an existing application to use asynchronous / websockets, you will have to set `DEBUG` in your production *environment* (not `settings_production.py`). More information in the [async documentation](async.md). *Oct 4, 2023* ## Version 2023.9.2 This is a hotfix release that bumps `django-environ` from `0.11.1` to `0.11.2` which fixes an issue with "$" in certain situations in environment variables. [details](https://github.com/joke2k/django-environ/issues/490) Thanks Geoff for reporting! *Sep 22, 2023* ## Version 2023.9.1 This is a hotfix release with a few small fixes and updates: - Updated the version of `celery[redis]` to `5.3.4` since `5.3.3` was inexplicably deleted from PyPI. - Fixed a crashing issue on the two-factor auth configuration pages caused by the recent `allauth-2fa` update. (Thanks Matthew for reporting and suggesting the fix) - Added tests for a few logged-in views, including one that would have caught the two-factor issue above. - Properly show errors if you enter the wrong two-factor token when trying to remove two-factor auth from your account. *Sep 18, 2023* ## Version 2023.9 2023.9 has two main updates: Stripe embedded pricing table support, and a substantially improved Wagtail experience. ### Stripe Embedded Pricing Table This release adds support for [Stripe's embedded pricing table](https://stripe.com/docs/payments/checkout/pricing-table), which is a far simpler alternative to creating a pricing page than doing it natively in your application. The pricing table was added as a new build configuration option. Once enabled, the previous subscription UI will be replaced by Stripe's UI, and all changes to the pricing table can be made directly within Stripe. The pricing table option opens up a number of new billing options, including multi-currency support and free trials, though it does not support per-unit billing very well. For complete details, see the [updated subscription documentation](subscriptions.md). ### Wagtail Enhancements The big Wagtail change is that most content pages now use Wagtail's `StreamField` instead of `RichTextField`. This allows you to stitch together arbitrary blocks of content in all your pages, instead of being forced into a single rich text model. It also enables re-use of individual structured components. You can [read more about Wagtail `StreamField` here](https://docs.wagtail.org/en/v5.1.1/topics/streamfield.html). There were also several smaller improvements. *If you're upgrading from a previous version, see the upgrading notes below.* ### Complete release notes #### Added - **Stripe: Added embedded pricing table support, via a new build option.** - Wagtail: Added `social_image` field to all content models (using `BaseContentPage`), so you can define a custom image to use for `og:meta` tags for any individual page. - Wagtail: Added a `CaptionBlock`, for captioning images or code, which you can use as a reference to add additional block types to your app. - Wagtail: Added a migration to port previous `RichTextField`s to `StreamField`s. - Added tests for `get_image_url` template tag. ### Changed - **Wagtail: Migrated `ContentPage.body` and `BlogPage.body` to use `StreamField` instead of `RichTextField`. This provides much more flexibility in laying out your pages and working with many different section types.** - Wagtail: All content models now extend from `BaseContentPage` so that you can add fields that should be shared among all your different types of content. - Wagtail: Updated the `bootstrap_content` management command to be compatible with the new structure. - **Upgraded nearly all Python packages to their latest versions.** `django-allauth` was not upgraded, due to it having a large release just a few days ago. - **Upgraded all JavaScript packages to their latest versions.** - **Subscriptions: official support for multiple currencies ([docs](subscriptions.md#supporting-multiple-currencies)) (Stripe pricing-table only)** - **Subscriptions: official support for free trials ([docs](subscriptions.md#free-trials))** - **Subscriptions: Overhauled the [Subscriptions documentation](subscriptions.md) to make it clearer, and add the new pricing UI setting.** - Subscriptions: Moved the `checkout_success` endpoint to be a global `confirm` endpoint instead of a team-specific endpoint. - Subscriptions: Improved display of subscription price line items when using metered billing. ### Fixed - Subscriptions: Fixed bug that caused trialing subscriptions to not be counted as active. - Subscriptions: Show the correct currency in subscription details page if using Stripe's [multi-currency support](https://stripe.com/docs/payments/checkout/present-local-currencies?platform=multi-currency-prices). (Thanks Mario for reporting.) - Fixed bug in `get_image_url` template tag that prevented it from properly resolving relative media URLs. Also added tests for this case. - Updated the `bootstrap_subscriptions` management command to be compatible with the latest version of `dj-stripe`. - Fixed a bug where the active products API would always crash if you had not defined `ACTIVE_PRODUCTS` ### Removed - Removed no-longer-supported `DJSTRIPE_USE_NATIVE_JSONFIELD` setting. ### Upgrade notes It is recommended to read through [the dj-stripe 2.8 release notes](https://github.com/dj-stripe/dj-stripe/releases/tag/2.8.0) to confirm you aren't affected by any backwards-incompatible changes. Customers switching to the new Stripe embedded pricing table will need to move any product information (including names, descriptions and feature lists) from `metadata.py` into their Stripe product and pricing page configuration. Customers upgrading from existing wagtail installations that have been customized may need to do additional work to update their content models to StreamFields. Look at the `0002_convert_stream_fields.py` migration and apply the same pattern to any other fields you want to migrate. *September 1, 2023* ## Version 2023.8.2 This is another bugfix release that fixes docker-based deployments (Digital Ocean, Heroku Docker, and fly.io). To get the fix you don't need to upgrade, just change the node version in your `Dockerfile.web` from 16 to 18. The updated line should look like this: ``` RUN \ echo "deb https://deb.nodesource.com/node_18.x buster main" > /etc/apt/sources.list.d/nodesource.list && \ ``` Thanks Matthias and Alexander for reporting this. *Aug 30, 2023* ## Version 2023.8.1 This is a bugfix release that fixes deployment to render. To get the fix you don't need to upgrade, just add these two lines to your `envVars` section in `render.yaml` to explicitly bump the node version used from 14 to 18. ```yaml - key: NODE_VERSION value: 18.17.1 ``` Thanks Greg and Michiel for the bug report and suggested fix. *Aug 21, 2023* ## Version 2023.8 This release adds official support for three marketing email platforms (Mailchimp, ConvertKit, and Email Octopus), adds dark mode on Tailwind builds, and has the usual smaller updates and fixes. ### Added - **First class support for marketing email lists.** You can now select a platform (Mailchimp, ConvertKit, Email Octopus, or none), and your build will be customized for that platform, including settings/environment variables, and automatically subscribing new sign ups to your email list (if properly configured). See the updated [mailing list documentation](configuration.md#mailing-list) for more details. - Added a management command to send test emails: `./manage.py send_test_email cory@example.com`. Useful when troubleshooting/changing how your server sends email. - **Added dark mode support for TailwindCSS builds.** Your app should automatically use dark mode if the user's browser is configured for it. Components that weren't properly styled for dark mode now are. If you spot any issues please report them! - The `get_next_unique_slug` helper function can now take filter arguments, so you can have unique fields dependent on other fields (for example, if you want to have slugs which are unique per team). - Added tests for `get_next_unique_slug` (including testing the new functionality). - Added view tests for the signup process with various edge-cases around team names.Docker - Added a `Makefile` target, and documentation for rebuilding the API client with Docker. [Documentation](apis.md#generating-the-api-client) (Big thanks to Finbar for helping on this) ### Fixed - Removed empty JavaScript files in certain builds that were causing `npm type-check` to fail. (Thanks George for reporting!) - Only try to log mailing list errors to Sentry if building with Sentry enabled. - Fixed a bug in `get_next_unique_slug` that was failed if you passed in a custom `slug_field_name`. Also added a test that would have caught it. - Fixed a bug where unicode team names were creating teams with an empty slug, which was causing a crash on logging in. - Fixed a typo in the `Makefile` (thanks Arno for reporting!) - [Documentation] Fixed issue in the digital ocean setup docs that was accidentally resulting in the creation of two Postgres databases, one of which was unused. (Thanks Thomas for reporting! - Removed links to user profile and signout views from the app navigation if there is no signed in user. ### Changed - **Upgraded all JavaScript packages to their latest (as of late July) versions.** - Use the project's slug in the `package.json` name instead of "pegasus". - Changed Twitter change social card format to `summary_large_image` - In the ChatGPT functionality, new chats are now not created until the first message is sent to them (HTMX only). This prevents empty chats from being created. - Improved link styling of chats on tailwind builds - Changed "loading-dots" CSS class to "add-loading-dots", to prevent conflict with DaisyUI class with the same name. - Users' chats are now sorted by last modification time, descending. - Profile picture validation now includes backend file-type checks, to avoid users uploading incorrect/malicious profile pictures. (Thanks Edward for reporting) - Stopped explicitly specifying a `platform: ` in `docker-compose.yml`, and instead always fall back to the OS's default platform. - Added `.jsx`, `.ts`, and `.tsx` as content roots in `tailwind.config.js`. ### Upgrading If you were previously using the mailchimp email functionality, you will need to edit your project and select "Mailchimp" under "Email Marketing Platform" to keep using it. *Aug 8, 2023* ## Version 2023.7 This is a large maintenance release with many improvements and a few new features. ### Added - **Expanded the built-in timezone support (if building with internationalization).** This includes: - A new timezone setting on the User model/profile. - A middleware that sets and unsets the timezone based on the user's setting. - A built-in list of default timezones. - **Added the option to remove compiled static files at Pegasus build time.** If checked, your Pegasus build will not include any static files, and they will be added to the `.gitignore` file. This is useful to check after you have set up static file builds as part of a CI/CD pipeline. [More here](front-end.md#long-term-best-practices). - **Added optional support for enabling Django's [admin docs](https://docs.djangoproject.com/en/4.2/ref/contrib/admin/admindocs/#module-django.contrib.admindocs) via a new project setting.** - Added improved Docker support for ARM / Mac M2 architectures, via a new project build option. This should improve the performance using Docker for affected OS's. ### Changed - **Removed all React dependencies and supporting code when building without React and without the built-in examples.** - Made order of example navigation and example homepage cards consistent. - Placed HTMX object lifecycle demo before the Vue one. - Better styling of terms link in signup forms (Tailwind builds only) - Moved `page_js` block to the bottom of the `` in the base template. This allows using other imported libraries (e.g. site-bootstrap.js) in inherited templates. (Thanks Finbar for suggesting) - Switched `UserLocaleMiddleware` to use the "new" style of Django middleware, using `__call__` instead of `process_request` and `process_response`. - Bumped Django version to the latest 4.2.3 security release. ### Fixed - **Refactored how custom components are added to Tailwind to follow the official guidance on [build-time imports](https://tailwindcss.com/docs/using-with-preprocessors#build-time-imports).** This fixes an issue where multiple style declarations of some classes were included, causing some CSS overrides to not work out of the box. It also results in improved CSS compile times and reduced output file sizes. Additionally, some tailwind styles were moved out of the main `site-tailwind.css` file and into other imported files. (Thanks Tyler for reporting and suggesting the fix!) - More gracefully handle when a Stripe subscription is deleted (usually in test mode), by logging an error and clearing it from the associated user/team object. - Added try/catch around Docker hostname setting for debug toolbar, which failed when running outside Docker on some OS's. (Thanks Geoff for the reporting/fixing) - Moved inline comments in `.env.example` that failed on some environments. (Thanks Geoff for reporting/fixing) - Stopped running `collectstatic` while building Docker containers on Google Cloud Run deployments, since the static files are managed outside the container for that platform. (Thanks Alexander for reporting) *Jul 9, 2023* ## Version 2023.6.1 This is a hotfix release that fixes a bug in the new Alpine.js form/attrs released in 2023.6 for some CSS Frameworks. *Jun 17, 2023* ## Version 2023.6 This is a minor release with some form updates and a bugfix for material Bootstrap builds. ### Added - Added the ability to specify attrs on form fields, along with special helper parsing for Alpine.js forms. - Added a forms example using Alpine.js to demonstrate Alpine.js form functionality, including hiding/showing a field based on the value of another field, rendering field values in labels, and changing the style of a field based on its value. The example is available at [http://localhost:8000/pegasus/forms/alpine/](http://localhost:8000/pegasus/forms/alpine/). - Added [documentation on forms](forms.md) in Pegasus. - Added `.pg-bg-danger` and `.pg-bg-success` helper classes for setting success/danger background colors. ### Fixed - Fixed some styling issues with Bootstrap 5.3 and the material theme. - Fixed the documentation for how to customize variables when using Bootstrap. *Jun 12, 2023* ## Version 2023.5.1 This is a small hotfix release, that includes a fix to a build error when using Bootstrap 5.3 (release yesterday). Details: - **Fix build errors when using Bootstrap 5.3** (Thanks Allan for reporting/fixing). - Remove `WAGTAILADMIN_BASE_URL` setting if not building with wagtail. - Remove some accidentally included tailwind CSS files when not building with tailwind. - Update the default copyright year in site footer to 2023 if JavaScript was not enabled. - Add `date_joined` to user admin list display / filter. - Cropped message content in Chat admin page. - Added a note to README about configuring Redis if not using Docker (thanks Chris for suggesting) *May 31, 2023* ## Version 2023.5 The big feature this release is a major enhancement to the OpenAI ChatGPT integration. This release also upgrades to Django 4.2 LTS and comes with the usual fixes and improvements. ### Chat UI Overhaul Here's a 3-minute demo video of the new ChatGPT functionality:
**Details:** - Made the Chat UI interactive using HTMX/React (depending on your project configration) and Celery, and greatly improved chat styling. - Moved chat example to a new chat app. - Added a chat history model and use it so that chats now have memory. - Added a chat list view unique to each user. - Added a `render_markdown` template filter, for converting Markdown to HTML in a template - Added serializers and admin for chat models. - Automatically set chat names based on the contents of the first message. - Add ability to set which chat model you use with the new `OPENAI_MODEL` setting. - Add `chat.css`/`chat.sass` files for framework-specific chat styling, with many helper UI classes related to the chat UI. - Removed previous Chat UI, including `PromptForm` class, and related view/template. ### Other updates in this release #### Added - Added `makemigrations` and `migrate` steps to README on sqlite builds (thanks Patrick for suggesting). - Added `{% block top_nav_app %}` to `app_base.html` to the material theme, so that the app nav can be overridden in sub-templates - Added make targets for running black (`make black`), isort (`make isort`), and both (`make format`) - Added `devtool: "eval-cheap-source-map"` to `webpack.config.js` to prevent source map warnings on Chrome. (Thanks Brett for suggesting) #### Changed - **Upgraded Django to 4.2 LTS, Wagtail to 5.0, and a handful of other Python packages to their latest versions.** - Switched from deprecated `DEFAULT_FILE_STORAGE` and `STATICFILES_STORAGE` settings to `STORAGES` setting (added in Django 4.2). - Set `EMAIL_SUBJECT_PREFIX` to be your app's name. This will be prepended to server admin emails. - Added a 5MB file size limitation to profile pictures, and delete old profile pictures when new ones are uploaded. (Thanks Jonathan for the suggestions!) #### Fixed - Fixed a bug where the app would crash if people signed up but already had an account, when teams were enabled. - Fixed crashing issues with running `./manage.py bootstrap_content` (and, resultingly, `make init`) multiple times in a row. - Removed accidentally included `team_nav.html` file on some CSS frameworks when teams was not enabled. - Fixed a bug where the `teams/manage/` url route was accidentally included in HTMX builds and not included in React builds. - Fixed a bug where profile picture upload styling wasn't applied on some CSS frameworks. ### Removed - Removed deprecated `USE_L10N` setting. *May 18, 2023* ## Version 2023.4.2 Another small hotfix release: - Fixes crash on `robots.txt` if you built without wagtail. - Added tests that would have caught the above issue (and also check other important pages). - Removed unused `TermsSignupForm` when building with teams enabled. *Apr 25, 2023* ## Version 2023.4.1 This release fixes two bugs: - Fixes crash on sign up under certain conditions when teams was not enabled. - Fixes crash when saving user profile data when API keys were not enabled. Thanks to Simon for reporting these! *April 21, 2023* ## Version 2023.4 This is a large maintenance release with many upgrades, cleanups, and a few small fixes. The biggest changes are upgrading the default Python version to 3.11, Node version to 18, and Docker compose version to 2. ### Python 3.11 update This release makes Python 3.11 the default supported version for everything in Pegasus. Details: - **Changed default Python version to 3.11.** Older version of Python (back to 3.8) are still expected to work, but are no longer actively tested. - Updated references in README and docs to use 3.11 everywhere. - Updated development Docker image to use 3.11. - Updated all deploy targets to default to 3.11. - Updated `black` and `isort` configs to 3.11. - Updated Github Actions to run tests on 3.11 only. Older versions can still be added back manually. - **Upgraded most Python packages to latest compatible Python 3.11 versions.** Django was not upgraded to 4.2, because Wagtail has not released support for it yet. If you aren't using Wagtail, you can upgrade to 4.2 now with no known issues. ### Node 18 update This release makes Node 18 the default supported version for everything in Pegasus. Details: - **Changed default Node version to 18**. Node 16 is still expected to work, but is not actively tested. - Updated references in README and docs to use 18 everywhere. - Updated development Docker image to use 18. - Updated all deploy targets to default to 18. - Updated Github Actions to run tests on 18 and 19 only. Older versions can be manually added back. - **Upgraded all node packages to their latest versions.** ### Docker compose update This release switches Docker compose to use version 2. Version 1 will be removed from Docker in a few months. More details in the [Docker docs](https://docs.docker.com/compose/compose-v2/). Details: - Switched all instances of `docker-compose` (v1) to `docker compose` (v2) in the `Makefile`. - Update all documentation to use `docker compose` instead of `docker-compose` ### Requirements update This release updates the Python requirements files (again). Apologies for the iteration on this---trying to find the best long-term workflow and hopefully this is it. - The `requirements/dev-requirements.txt` (and `.in`) file no longer includes everything in `requirements/requirements.txt`. It now only has the requirements used *only* in development. And is (still) constrained to use the same requirements as `requirements/requirements.txt` if any duplicate packages are included, as [described here](https://pip-tools.readthedocs.io/en/latest/#workflow-for-layered-requirements). - Added a `dev-requirements.txt` file in the root of the project to install both normal and dev-requirements. - Updated usages of dev-requirements to use the new system, e.g. in Github Actions. ### Other changes Smaller updates in this release are below. #### Added - **You can now automatically remove the teams example. Uncheck "include Teams example" in your project settings.** - Added an "I agree to terms" checkbox on sign up for all CSS frameworks. - Added link to impersonate a user to the app navigation on tailwind builds. - Added a basic `robots.txt` file that disables crawling on the admin and wagtail admin sites. (Thanks Alex for suggesting) - Added `OPENAI_API_KEY` to `.env` file if building with OpenAI examples enabled. #### Changed - Switched template setting to use `loaders` instead of `APP_DIRS` and disable template caching in development (thanks Michael for suggesting) - Add apps directory to places Tailwind looks for templates, so that any CSS classes defined there are properly applied. #### Fixed - Fixed a bug where `./manage.py bootstrap_content` didn't work if you didn't have translations enabled. - Fixed a bug where `black` and `isort` occasionally conflicted on import styles. - Changed a few single-quotes strings in commented code to use double-quotes to match black styling. - Added a missing trailing slash in a teams url. - Added a default empty string to `AWS_ACCESS_KEY_ID` in `settings.py` (this avoids potential crashes running `collectstatic` if it wasn't set in the environment). - Fixed a bug where custom form classes were not applied to input fields on Tailwind. (thanks Lars for reporting) - Always include `"allauth.socialaccount"` in `INSTALLED_APPS`, otherwise deleting users fails. (thanks Jonathan for reporting) #### Removed - Removed internal subscriptions API endpoints from the generated API documentation and API clients. If you'd like to keep these, you can remove the `exclude=True` line from the `extend_schema` declaration in `subscriptions/views/api_views.py`, and then [rebuild the API client](apis.md#generating-the-api-client). #### Documentation - Overhauled the documentation on working with [virtual environments](python.md) and made `venv` the default recommendation over `virtualenv`. ### Upgrading / breaking changes - If you don't have Docker compose V2 installed you will need to install it to continue using the `Makefile`. This is recommended, since V1 is being removed from Docker Desktop soon. - There are no known breaking changes related to the Python and Node upgrades, but it is recommended to upgrade your projects if you haven't already. You may need to [rebuild your Python requirements](python.md#working-with-requirements) on older versions to get backports packages. *April 20, 2023* ## Version 2023.3.5 A hotfix release, which fixes an issue introduced in `2023.3` where alpine.js was not properly included in the base template if you built with React instead of HTMX. This resulted in the subscription selection UI not appearing properly. *March 25, 2023* ## Version 2023.3.4 Another minor release with a few small fixes. ### Changed - Add `restart: unless-stopped` to web container docker-compose config, so that the web process still restarts on things like syntax errors. (Thanks Moritz for suggesting) - Code formatting checks in Github Actions now run on the entire codebase instead of just the diffs in pull requests. ### Fixed - Upgraded `cryptography` to version `39.0.2` which patches some high-severity vulnerabilities. (Thanks Michael for reporting) - Fixed an issue with `boto3` accidentally not being included in requirements files when you enabled S3 media. (Thanks Elliott for reporting) - Fixed an issue caused by [this issue behavior in Github Actions](https://github.com/actions/runner/issues/1189) that always caused code formatting checks to fail. (Thanks Elliott for reporting) *March 22, 2023* ## Version 2023.3.3 The main feature in this minor version is an OpenAI demo, showing how you can quickly integrate ChatGPT and DALL-E 2 into your Pegasus apps. Here's a 3-minute demo video:
There are also some small fixes (details below). ### Added - ChatGPT and DALL-E 2 demos. To use these you need to check the "OpenAI demos" box in your project settings. - You can now disable translations when building, which removes locale files and related code. ### Changed - `dev-requirements.in` and `prod-requirements.in` now constrain package versions to those included in `requirements.in`. This should prevent library version conflicts between files. - Remove `apps.utils.slug` and related test code if not building with teams enabled. - Remove entire JavaScript API client if not building with any APIs enabled. - Remove `storage_backends` if not building with S3 media support. ## Fixed - Removed extraneous packages that were accidentally be included in `dev-requirements.txt` even if you had built without certain features enabled. If you saw a big diff after running `pip-compile requirements/dev-requirements.in` on a recent build, this was why. - Made all package versions consistent between `requirements.txt` and `dev-requirements.txt` *March 14, 2023* ## Version 2023.3.2 This release fixes two small bugs (introduced in `2023.3`): - Fixed a syntax error in `render.yaml` that caused deployments to fail. Also removed unnecessary variables from that file if you weren't using subscriptions or sentry. - Fixed an issue in the code formatting CI setup that caused the formatting checks to fail on commits made directly to a branch. Now formatting CI is only run on pull requests. *March 6, 2023* ## Version 2023.3.1 This release fixes a bug (introduced in `2022.12`) that caused the `AUTH_PASSWORD_VALIDATORS` setting to be ignored when building with teams enabled. You can also manually patch this bug with the following change: In `apps/teams/forms.py` replace this line: ```python cleaned_data = super(SignupForm, self).clean() ``` with ```python cleaned_data = super().clean() ``` Apologies to any affected users! Will be adding a test for this in a future release. *March 5, 2023* ## Version 2023.3 This release includes several new features as well a lot of maintenance work. These are the biggest changes: ### Code formatting Pegasus will (optionally) now auto-format your Python code using [black](https://black.readthedocs.io). In addition to formatting, Pegasus now ships with [pre-commit hooks](https://pre-commit.com)---which you can install to ensure your code matches the expected format---and adds format checks to your Github actions CI. Much more detail can be found in the new [code formatting docs](code-structure.md#code-formatting). This option is enabled by default for new projects, and it's recommended that all existing Pegasus projects upgrade to this format, as it will make future merges/upgrades much easier. Guidance on upgrading [can be found here](cookbooks.md#migrating-to-auto-formatted-code). ### S3 production media support You can now use S3 to store your project's production media with just a few lines of configuration. To use S3, enable the "Use S3 for storing public media files" option in your project's configuration, and then follow the new [S3 media documentation](configuration.md#setting-up-s3-media-storage). ### Django debug toolbar Pegasus now (optionally) ships with the popular [django-debug-toolbar](https://github.com/jazzband/django-debug-toolbar) package. You can enable this option in your project configuration, and it will be enabled by default in development environments and turned off in production. More details in [the documentation](configuration.md#django-debug-toolbar). ### Alpine.js support The [Alpine.js](https://alpinejs.dev/) library has been officially added as a dependency to all Pegasus builds. Using Alpine allows replacing large amounts of custom JavaScript with a small amount of markup. The subscriptions UI was updated to use Alpine, and more features will move to Alpine in the future. *Below is the complete changelog for this release:* ### Added - **Added pre-commit/black support, as described above and in the [code formatting docs](code-structure.md#code-formatting)** - **Added django-debug-toolbar, as described above and in [the `debug-toolbar` documentation](configuration.md#django-debug-toolbar)** - **Added S3 media support, as described above and in the [S3 media documentation](configuration.md#setting-up-s3-media-storage).** - **Added Alpine.js as a top-level JavaScript dependency, included on all pages.** - **Added `dev-requirements.in` and `dev-requirements.txt`, for requirements that should only be installed in development (e.g. `pip-tools`, `debug-toolbar`, `black`, etc.** - Added health checks to Docker postgres and redis, to ensure they are ready before other containers start. (thanks Moritz for suggesting!) - Added a `make npm-dev` command to build front end for development in Docker. - Added a wrapping `meta` block to `base.html` to make overriding the page-level metadata more flexible. Wagtail blog post pages now use this to override the page title and description for social sharing. - Added `.direnv` and `.envrc` files to `.gitignore` - Added global `[x-cloak]` style to hide elements in Alpine. ### Changed - **Migrated subscription selection flow from JavaScript to Alpine.js** and deleted a lot of custom JavaScript code that was no longer necessary as a result. - Updated `ProductWithMetadata` serialization format remove monthly/annual/default prices, and add a dictionary of prices based on billing interval. - As a result, **Pegasus now supports more than two billing intervals (you can now add any of Annual / Monthly / Weekly / Daily)** - Migrated help text under the billing interval selector to the `PlanIntervalMetadata` helper class and removed front-end styling. - Added `payment_amount` field to the Product/Price API serializer. - **Removed stripe packages, dependencies, and all related code/styles if you build without subscriptions and without examples.** (thanks Brett for suggesting!) - Moved stripe `card_element.html` component to `pegasus/examples/payments/components/card_element.html`, and only include it if you build with examples. - Upgraded generated API client to version 6.4.0, and regenerated the API client. - Upgraded django to 4.1.7 and celery-progress to 0.2. - Added `SOCIALACCOUNT_LOGIN_ON_GET = True` to `settings.py`. This removes the extra confirmation page for social sign ups, improving the UX, though does open up a minor security risk [outlined here](https://github.com/pennersr/django-allauth/blob/master/ChangeLog.rst#security-notice-1). Remove this line if you prefer to keep the extra page. - Saving a user profile now shows a confirmation message. (thanks Viktor for suggesting!) - `make upgrade` now rebuilds your `requirements.txt` files and your front end. (thanks Brett for suggesting!) - `STRIPE_LIVE_MODE` is now automatically set to `True` in Render deployments. (Thanks Adrian for suggesting!) - Regenerated translation files for latest code changes. ### Fixed - Removed "https" prefix from fly.io host checks, which caused them to fail. - Fixed the url in the "Add a Password" link on the user's profile to go to the set password page. This link is only visible if the user signs up via social auth. (Thanks Blake for reporting) - Added a workaround for an allauth bug that causes occasional 500 errors when users tried to sign in with a social account that was already tied to an existing email address, by using a `CustomSocialSignupForm`. - [Details here](https://github.com/pennersr/django-allauth/blob/master/ChangeLog.rst#backwards-incompatible-changes-). (Thanks Simon for finding and fixing!) - Fixed issue with `make npm-type-check` not being available if Wagtail wasn't enabled. - Stop logging errors adding people to the mailing list if they were already on it. - Improved styling of documentation link when subscriptions were improperly configured dn Tailwind builds. ### Removed - Removed helper functions on `ProductWithMetadata` related to monthly/annual pricing (e.g. `monthly_price`). - Removed the no-longer-used `get_payment_metadata_from_request` helper function. - Removed the no-longer-used `catch_stripe_errors` decorator. - Removed legacy styling markup from subscription details page. (thanks Viktor for reporting!) ### Documentation - **Added write up about [the front end files](front-end.md#providing-site-wide-javascript).** - **Added write up about managing [test vs live Stripe products](subscriptions.md#stripe-in-production)** - **Improved the [internationalization/translation docs](internationalization.md).** - **Added [a cookbook for how to enable auto-formatting on your existing project](cookbooks.md#migrating-to-auto-formatted-code).** *March 3, 2023* ## Version 2023.2 This release was driven by feedback from the Pegasus community. It includes many library upgrades (including updating to the latest Django), the ability to build without the Pegasus examples, and small changes and fixes. ### Added - **You can now build Pegasus projects without the built-in examples.** - More type hints to return values in subscriptions module. - `SubscriptionWrapper` object now has a `products` property to get associated Stripe products. ### Changed - **Upgraded all Python libraries to their latest versions (including Django to 4.1.6)** - **Upgraded all JavaScript libraries to their latest versions.** - **Update HTMX installation to use the webpack build pipeline. (HTMX builds only)** - Set CSRF token on the site body, for usage in HTMX, as [outlined here](https://django-htmx.readthedocs.io/en/latest/tips.html#make-htmx-pass-the-csrf-token). - Added site name to admin sign up notification. - Built-in admin emails now fail silently and don't cause sign-up errors if email sending fails. - Made it possible to configure `ACCOUNT_EMAIL_VERIFICATION` separately by environment, so it can be enabled in production but disabled in dev. - Made it possible to view/edit User's selected language in the Django admin. - Updated `make pip-compile` to also compile your production requirements file (if relevant). - Fly.io HTTP checks will now run using the site's configured HTTP HOST header. ### Fixed - Fixed a bug introduced in 2022.12 that resulted in a duplicate team being created when users created an account while accepting a team invitation (Bootstrap and Tailwind only). - Cleaned up styling of Monthly/Annual selector buttons on subscription UI (Tailwind only). - Made icons in menus consistent sizes, to prevent minor alignment issues with wider/narrower icons (Tailwind only). - Fixed an issue preventing user profile data from being saved if internationalization was enabled, but only a single language was configured. ### Upgrading If you don't want to upgrade Django to 4.1 this upgrade *should* be backwards compatible. Pin the Django version to 3.2.x in your requirements file and [rebuild requirements](python.md#working-with-requirements). *Feb 1, 2023* ## Version 2022.12 This is a maintenance release with many small fixes and quality-of-life improvements suggested by the community. Happy holidays! ### Added - Added a `make upgrade` target to update docker containers and a local database after upgrading. - Added a Redis instance to Github actions CI setup, so that any tests which depend on Redis can run without modification. - Added default error pages and url routes for 400 and 403 errors. ### Changed - **Updated usage of `.env` files. Python environments now use `.env`, docker uses `.env.docker`, and the example was renamed from `.env.dev.example` to `.env.example`. [Details here](configuration.md).** See upgrade notes. - **Invitations can now only be accepted from the email address that was invited.** See upgrade notes. - Blog posts in wagtail are now listed in descending order (by date) - Optimized the `Dockerfile.dev` so that requirements are installed prior to copying the complete source code of the project. This results in substantially reduced image build times when requirements have not changed. - Replaced instances of `%` string formatting with `str.format()` - Update `make pip-compile` and `make requirements` build targets to also build production requirements. (thanks Brett!) - Updated error pages to use a shared base template. - Added translation markup to a handful of places. ### Fixed - Remove `customer` from the user admin for team builds (this was causing the User admin to error for team-based builds if subscriptions were enabled). - Update the `bootstrap_content` management command to publish content (in addition to creating it). - Fixed crashing error on `@active_subscription_required` decorator if user was not logged-in. - Fixed image responsiveness on Wagtail blog posts on Bootstrap-based builds. - Set `LOGIN_URL` in settings, which prevents issues arising if you change the default location of `allauth` urls. - Fixed image styling on the teams list page if you weren't a member of any teams. (htmx builds) - Fixed a minor markdown-styling issue in the README. - Automatically sync Stripe API keys from settings/environment to database when running `bootstrap_subscriptions`. This fixes the following error on new projectsc: "You don't have any API Keys in the database. Did you forget to add them?" - Removed unused import of C3 styles from the charts example template. - Fixed a static image reference on the example pricing page. ### Upgrade notes **`.env` updates** The moving around of `.env` files may impact existing development environments. For those using Docker, it is recommended to rename your `.env.dev` to `.env.docker`. **Invitation changes** If you wish to preserve the previous behavior that allowed accepting an invitation from any email address: 1. Remove the email address validation check in `apps.teams.forms.TeamSignupForm` by deleting these three lines: ```python if invite.email != email: raise forms.ValidationError(_( 'You must sign up with the email address that the invitation was sent to.' )) ``` 2. In `templates/account/signup.html` make the email field editable by changing the following line ```html ``` to: ``` {% render_text_input form.email %} ``` *Dec 27 2022* ## Version 2022.11.1 This release is a minor/hotfix update with a few small changes. ### Added - Added `clear_cached_subscription` helper function to `SubscriptionModelBase` ### Changed - Upgraded dj-stripe to 2.7.2. This fixes several crashing errors when using more complex subscription/billing models. ### Fixed - Catch and fix Stripe errors when trying to view a cancelled subscription that has not been synchronized with Stripe *Nov 4 2022* ## Version 2022.11 There are a number of big updates in this release. ### Feature: Feature flag support Pegasus now supports using feature flags with waffle. For full details, see the new [feature flag documentation](flags.md). Included in the implementation: - A custom `Flag` model that allows turning features on and off for an entire `Team`. - A new example page showing how to use feature flags in Python, Django templates, and JavaScript - Added some helper CSS classes to display badges (used in the example) ### Cleanup: Settings Overhaul The main change is to move most configurable settings into environment variables (now managed by [`django-environ`](https://django-environ.readthedocs.io/en/latest/)), and reduce the number of settings files used. Supporting/related work: - **Switch environment variables in settings to use `django-environ` and made more settings configurable via environment variables.** - Support configuring database with single `DATABASE_URL` setting if defined. - Moved redis configuration to default `settings.py` and allow overriding with environment variables. - Renamed all platform-specific settings files (e.g. `settings_heroku.py`) to `settings_production.py`. - **Removed `settings_docker.py` which was used in development with Docker. Docker-specific settings are now overridden via environment variables in the `.env.dev` file.** - Replaced usage of `django-heroku` with normal settings. Previously this was used to configure the database URL and whitenoise for Heroku. Both of those changes have been rolled into the default settings files. ### Feature: Render deployment option Pegasus now officially supports deploying to [Render](https://render.com/). See the new [Render deploy documentation](deployment/render.md). ### Feature: Fly.io deployment option Pegasus now officially supports deploying to [fly.io](https://fly.io/). See the new [Fly.io deploy documentation](deployment/fly.md). ### Feature + Cleanup: Subscription updates Most of these changes are backend cleanups to help improve future Subscription work. *Full support for multiple subscriptions and metered billing will hopefully be in an upcoming release.* **Enabled backend support for subscriptions with multiple products.** Related changes: - Switched all references of djstripe's deprecated `Plan` model to use the `Price` model. - Updated Subscription serialization to support multiple items / prices / products and changed `PlanSerializer` to `PriceSerializer`. - Changed suffix in property names in `ProductWithMetadata` class from `_plan` to `_price`. - `active_subscription_required` decorator now checks all prices/products associated with a subscription if `limit_to_plans` is specified. - Removed `get_product_and_metadata_for_subscription` and `get_subscription_metadata` functions. - Added `SubscriptionWrapper` class to help encapsulate more complex subscription logic to a single place, and use it instead of `Subscription` objects and lots of extra context variables in templates. - Added `InvoiceFacade` class to provide a few utilities to help display a Stripe Invoice object. **Enabled backend support for [usage-based/metered billing](https://stripe.com/docs/billing/subscriptions/usage-based).** Related changes: - Fixed crashes on subscription signup and details pages if your plan was configured with metered billing. - Added demo form for reporting usage to Stripe for metered plans. **Changed the Stripe Customer object to be associated with the Team (instead of the User) for Team-based projects.** Related changes: - Remove `customer` from the `CustomUser` model and add it to `SubscriptionModelBase` (which will go to the `Team` on team-based builds) - Set the `DJSTRIPE_SUBSCRIBER_MODEL` to the Team object, if using teams. - Updated logic that gets/sets the customer to use the Team instead of the user. - No longer force using the logged-in User's email address at checkout (for team based builds), so they can specify a different billing email. - No longer re-use credit cards / Customers when the same user signs up for subscriptions in multiple teams. *See the upgrading guide below for details on navigating this change.* ### Other Changes - **Upgraded font awesome to the latest version (6.2) and load the CSS from a CDN.** - Upgraded djstripe to version 2.6.2 - Added user and team metadata to the Stripe subscription object during Checkout, so Subscriptions can be more easily linked back to your app from the Stripe Dashboard. - Added translation markup to a handful of pages. - Switched Google / Twitter brand icons to be displayed inline, and use icon-sized images. - **Replaced "icon" CSS class with "pg-icon" to avoid conflicts with framework classes.** In particular, this fixes some issues with Creative Tim themes beyond what's included in Pegasus. - Removed icons from subscription plan selector. - **Use whitenoise for static files in development if deployment is configured for it.** This makes development environments more like production, though is largely invisible. - **All docker-based deployments now build front end assets as part of the deploy step**. Previously this was only done for Heroku-based deploys. - **All docker-based deployments are now based off the `buster` image.** - Added `--noinput` to heroku migrations command. - Deployments that run Celery now run it with the `--beat` option by default, and a concurrency of 2. - Increased length of generated secret key in production environment files. - Upgraded Node versions that run on CI to 16, 18, and 19 to reflect the current releases. - Upgraded Github actions versions for several steps to fix Node deprecation warnings. - Production Dockerfiles now run gunicorn by default (this can be overridden in the platform-specific tools, e.g. to run celery) - Rebuilt the JavaScript API client to reflect the latest API views and serializers. ### Other Fixes - Fixed all schema warnings from `drf-specatcular`, by adding inline serializers or annotations to several APIs. - Fixed styling bug in showing a user's connected accounts on Tailwind builds. - Properly hide delete button text on small screens in HTMX object demo. - Replaced many instances of `trans` with `translate` and `blocktrans` with `blocktranslate`. - Set the page title of Wagtail blog posts to the blog post title. - Fix active tab highlighting in examples navigation for some CSS frameworks. ### Removed - Deleted no-longer-needed static images for Twitter / Google logos. - Removed unused "is-small" class from various icon markup. - Removed unused styling block for `th` elements in `subscriptions.sass` ### Upgrading The major change that requires care in upgrading is the migration of the `customer` field from the User to the Team for team-based builds. If you do NOT have any live customers associated with your Users the migration process is standard, just run `./manage.py makemigrations` followed by `./manage.py migrate`. **Note: this will drop all User-->Customer relationships.** If you DO have live customers associated with your Users, and you want to preserve this data, the migration process is more complicated: First, add the following line *back* to the `CustomUser` model: ```python customer = models.ForeignKey(Customer, null=True, blank=True, on_delete=models.SET_NULL) ``` Next, create and run migrations: ```bash ./manage.py makemigrations ./manage.py migrate ``` Next you need to move the `Customer` from the user to their team. You can do this by running: ``` ./manage.py migrate_customers_to_teams ``` If the customer only had a single subscription, it will be correctly applied to the right team. If the customer had multiple subscriptions, the command will print out errors *which you must resolve manually*. You can either choose to drop this information, or associate the customer with a single Team. Once you are happy with how you've migrated the data you can remove the `customer` field from above from the user, and run `./manage.py makemigrations` followed by `./manage.py migrate` to drop it from the user table. Feel free to reach out in #support on Slack if you need any assistance with this process! *Nov 4 2022* ## Version 2022.10 This release adds two-factor authentication, and has a number of smaller improvements and fixes. ### Added - **Two-factor authentication.** Users can now set up two-factor authentication on their account (using Google Authenticator or similar), and will be required to enter a token to login. This is configured from the user's profile page. More [documentation here](2fa.md). ### Changed - Improved UI feedback in React Teams UI and Employee example when the API client can't load data. - Wagtail and admin login pages now redirect to the main login page (this prevents users from bypassing two-factor authentication, if enabled). - Added top navigation bar to tailwind account pages. - The teams middleware will now raise a 404 if a user tries to access a page associated with a team they were not a member of. Previously this was only enforced by the `login_and_team_required` decorator, not the middleware. Also added/updated tests for this case. - Added type hints in a few more places. - Made minor improvements to API schemas, including fixing some warnings that arose during schema generation. - Upgraded generated API client to version 6.2.0, and brought in changes from above schema changes. - Upgraded Django to the latest security LTS release (3.2.16) ### Fixed - Fix an issue in Bootstrap builds where some material styles were being applied to the initial download even if you didn't choose the material theme. - Fixed a bug where certain pages would fail to load if teams were enabled but the logged in user was not a member of any teams. *October 6, 2022* ## Version 2022.9 The major addition in this release is support for internationalization, a.k.a. translating your app into multiple languages. Here is a quick demo:
This includes support for text localization in Python, Django templates, JavaScript and Wagtail. Translations can be set anonymously (via a cookie) or based on the logged-in user's selected language. See the new [Internationalization docs](internationalization.md) for more information. Major related changes: - Added a language selector to the site footer for users who aren't logged in. - Added a `language` field to the `CustomUser` model and profile page. - Added `UserLocaleMiddleware` to set the user's language whenever they are logged-in. - Update wagtail bootstrap code to generate localizable pages. - Added translations markup to a substantial subset of code across Django views, templates and JavaScript. More translation markup will be added incrementally with new releases. - Replaced `trans` templatetag with `translate` in a number of places. ### Other Changes - **Attach team models to the request in middleware instead of view decorator.** This means that `request.team` will be available on every request, so team navigation will be available even on pages like a user profile that are not team-specific. For details see the updated [teams middleware docs](teams.md#middleware), as well as the upgrade notes below. - Added tests for the above middleware, and updated other tests to be compatible with it. - Added a context processor so that `team` is always available in the template context. Also removed code setting `team` in context in `TeamObjectViewMixin`. ### Fixes - Don't show pages on the blog index if they are published then unpublished (Wagtail only, thanks Peter for reporting!) ### Upgrade notes - If you use *teams* and are upgrading from a older version you must make sure that your middleware includes `apps.teams.middleware.TeamsMiddleware`. It should be placed directly after `django.contrib.auth.middleware.AuthenticationMiddleware`. *September 1, 2022* ## Version 2022.8.2 This is another hotfix release. Thanks Daniel and Jacob for reporting bugs! - Fix error loading API Schema file when building without API keys enabled. - Added a test that would have caught the above error. - Removed unused site-bundle.js file. - Fix pyyaml requirements conflict when installing with Google Cloud enabled. *August 5, 2022* ## Version 2022.8.1 This is a hotfix release with a few fixes from the last build. Thanks to Jim and Logan for quickly reporting issues! ### Fixes - Fix environment variable name used for database port in settings.py. - Removes accidentally added text from the landing page (Tailwind builds only). - Added instructions to run `./manage.py makemigrations` when setting up a database to the README. *August 3, 2022* ## Version 2022.8 The major addition in this release is official support for Tailwind CSS. There were also a number of smaller fixes and improvements. ### Official Tailwind CSS support Pegasus now officially supports [Tailwind CSS](https://tailwindcss.com/)! Here's a 3-minute walkthrough:
Some of the larger changes to the Tailwind functionality include: - Upgraded TailwindCSS to version 3 and all dependencies to the latest versions. - Added a [daisyUI](https://daisyui.com/) dependency and overhauled most of the tailwind templates with daisyUI components. - Overhauled navigation bar and menus, and added a daisyUI-based mobile dropdown menu for mobile navigation. - All Tailwind pages are now mobile-friendly. - Added `tailwindcss/typography` plugin for content. - Improved tailwind-based Django form rendering and integrated the forms with daisyUI components. - Improved styling of app notifications/messages. - Added modal dialogs to the team deletion and membership removal workflows (team builds only). - Removed many no-longer-used classes form `site-tailwind.css`. See the updated [Tailwind docs](/css/tailwind/) for more information and customization options. ### Other Additions - **Pegasus now ships with a default, customizable logging configuration.** [Documentation](configuration.md#logging). - Added several new helper CSS classes, including `pg-content` (for content), `pg-columns-reversed` (for reversed columns), `pg-align-items-center` (a flexbox utility), and various `pg-text-` classes for coloring text. ### Other Changes - **React-based team deletion now works like the HTMX version, with a pop-up confirmation modal.** The "Delete" button was removed from the team list UI. - **Deleting a team/user will now automatically cancel any subscription associated with that team/user.** (thanks Florian for reporting!) - **Updated many templates to use `pg-` Pegasus helper CSS classes instead of CSS-framework-specific ones.** Affected places include: several places in the Pegasus examples, `app_home.html`, the user `profile_form.html` and social account connections page, the React teams editing UI, subscription helper pages, default landing page, password reset pages, team invitation pages, user impersonation, wagtail / blog pages, 404 / 500 pages and more. - Replaced underscores with hyphens in example URLs. - Increased margins between buttons and forms/controls in a few templates. - Improved styling of the default email management page. - Upgraded several NPM packages to the latest versions including Bootstrap version to 5.2. - Overhauled [CSS docs](/css/). - Mark `help_text` as safe in form_tags (allows adding links and other HTML to your help text) - Add trailing slash to urls in `apps/web/urls.py`. - Updated default CI configuration to build all pull requests (was previously all pull requests to `main` only) ### Other Fixes - **Fixed bug where non-admins did not see a link to manage their own membership from the team details page.** (React builds only) - Fixed styling issues with some tables on small screens. - Removed empty if/else block from `team_nav.html` if building without subscriptions. - Fixed a bug in `@active_subscription_required` decorator where an invalid subscription could cause a crashing error instead of redirecting to the subscription management page. (thanks Jon for reporting!) - In object home examples, list "four" technologies instead of "three" *August 1, 2022* ## Version 2022.7.1 This is a hotfix release that fixes an "Undefined variable" error when building the front end with the Bootstrap Material theme, and Bootstrap 5.2. More details on the root issue can be [found here](https://github.com/twbs/bootstrap/issues/36785). *July 22, 2022* ## Version 2022.7 This release was largely focused on addressing technical debt and further modernizing some of the front end code that ships with Pegasus. Due to the large number of updates, a few major changes have been grouped together. ### Added TypeScript support The Pegasus front-end build pipeline now supports [TypeScript](https://www.typescriptlang.org/). You can continue to write code in normal JavaScript, or introduce TypeScript incrementally on new code, on a file-by-file basis. Future versions of Pegasus are likely to incrementally port more code to TypeScript, similar to how types have been incrementally introduced into the Python code. Related changes: - Added TypeScript transpilation to the front end build pipeline. - Added `npm run type-check` and `npm run type-check-watch` targets. - Added `make npm-type-check` target for Docker environments. - Run type checks as part of the Github Actions front end build step ### Upgraded all JavaScript packages The `npm-check-updates` command was run on the entire front end, and with the exception of TailwindCSS, *every package in `package.json` was upgraded to the latest version*. Some of the larger updates (for which there were also code changes to make them compatible) include: - Upgraded Vue.js from version 2 to version 3 and made Employee app compatible with Vue 3. - Upgraded React to version 18 and react-router to version 6, and updated all code to be compatible with new versions. ### Overhauled the API documentation and API clients This release removed the deprecated CoreAPI-based API schemas and JavaScript client and replaced it with OpenApi3 schemas (using [drf-spectacular](https://drf-spectacular.readthedocs.io/)) and generated client code. For more information on using APIs in your Pegasus app, see the new [API docs](/apis/). Details related to this change: - Added new `drf-spectacular` Python dependency and removed the `coreapi` Python dependency. - Added `@extend_schema` markup to most APIs to improve and simplify the generated OpenAPI3 schemas - **Added new default endpoints for the OpenAPI3 schema.yml file, Swagger API docs, and Redoc API docs.** - **Added a new TypeScript API client that ships with the front end code.** - Updated all JS client code to use the new client, including the employee demos, React-based team management views, and chart demo. - Removed no-longer-used coreAPI helper functions from `assets/javascript/api.js`. - Removed no-longer-needed `assets/javascript/teams/api.js`. - Removed no-longer-needed `app.Api` from the front end code. - Added `openapitools.json` to `.gitignore` - Added [documentation related to these changes](/apis/). ### Other Additions - `project_meta` context processor now includes `server_url` (the absolute URL of your app) in the context. - `get_server_root` helper function to support the above. - Doc strings for helper functions in `apps/web/meta.py` - Type hints for various helper methods inside Django models. - Add `pip-tools` to dev Dockerfile so `requirements.txt` can be built in the container. (Thanks Brett for the suggestion!) - Add `make pip-compile` target for rebuilding `requirements.txt` and `make requirements` file for rebuilding requirements.txt, and rebuilding/restarting your Docker containers. - Team management URL is now included in team API urls. (React UI only) ### Other Fixes - Properly handle team name and slug validation in team editing UI (React UI only) - Changing the team slug now properly refreshes the page, so links don't break. (React UI only) - Fixed typo in variable name in `get_team_api_url_templates`. ### Other Changes - **Switched chart examples and supporting code from `c3.js` to [`Chart.js`](https://www.chartjs.org/).** - Upgraded Django to the latest LTS security release (3.2.14). - Dev docker set up now starts celery with the beat flag enabled. - Increased the top margin between the navigation and content in content base template. (Bootstrap only, thanks Will for suggesting!) - Deleted some accidentally-included commented out code in the Vue employee demo. *July 8, 2022* ## Version 2022.6 The main feature of this release is a brand-new integration with Wagtail. [Wagtail](https://wagtail.org/) is a powerful CMS (Content Management System) built on top of Django. You can use it to create rich websites that can be edited directly via an authoring admin interface without writing any code. It's great for creating marketing sites, blogs, and other mostly-static content. You can learn more about Wagtail and Pegasus in this 5-minute overview, or by heading over to the [Wagtail documentation](/wagtail).
Complete release notes are below: ### Added - **Pegasus now supports Wagtail! [Documentation](/wagtail/).** There are a fair number of changes to support this work, most of which are only relevant if you enable wagtail support. The main ones includ a new `content` app, a large number of new Python package dependencies (all stemming from `wagtail`), and some updates to the site navigation. - **Pegasus now generates a sitemap for you.** [Documentation](page-metadata.md#sitemaps). - **Responsive HTML email templates were added for the default email confirmation and password reset emails.** - Add `get_protocol` helper function to return the string "http" or "https" depending on `settings.USE_HTTPS_IN_ABSOLUTE_URLS` ### Changed - Social sign ups will now automatically create a default team if not there. - The `login_and_team_required` decorator now falls back to the default team from the session/user if not available from URL (thanks Van for the suggestion) - Add link to the profile page to set a password if the user only has a social account setup. - Improve the default UI for setting a password. - Split the top navigation for the app template into its own template (`top_nav_app.html`). (Material Theme Only) - Show top navigation menu even if user is logged in (but hide the sign up / sign in buttons) (Material Theme Only) - Increase top margin on 404 and 500 error pages (Bootstrap only) - Reduced whitespace in some html templates. - Changed reference of `djstripe_sync_plans_from_stripe` to `bootstrap_subscriptions` in subscription error message. - Removed "[project name]" prefix from signup / password reset emails - Refactor: use `get_protocol` and f-strings in `absolute_url` helper function - Removed "More coming soon" text from the Pegasus examples homepage. ### Fixed - Fixed `pyparsing` version conflict between regular and production requirements (Google Cloud builds only) - Fixed subscription price displays when using graduated pricing. (Thanks Lachlan for reporting) - Remove Heroku Dockerfile from build if not using it *June 21, 2022* ## Version 2022.5 This release improves many of the details of the Stripe subscriptions integration. To streamline these changes, Stripe Elements support has been removed, and subscriptions will be Checkout-based moving forwards. The release also many small fixes and improvements. ### Added - **Re-use the Stripe `Customer` object when a User has multiple subscriptions / payments (by saving it on the User model). This prevents users from having to re-enter their cards multiple times.** - **Added an `active_subscription_required` decorator for easier subscription feature-gating. [Docs](using-the-active-subscription-required-decorator)** - **Added a periodic task to sync subscriptions with Stripe every day when per-seat billing is enabled.** - Added a slug field to `ProductMetadata` to be able to uniquely refer to products in code. - Added `sync_subscription_model_with_stripe` helper function (logic was previously only in `sync_subscriptions` management command) - Stripe subscriptions are now created with a human-readable description with the team/user associated with the subscription. - Show expiration date on subscription details when auto-renewal has been turned off - Docker projects now include a `.env.dev.example` file to use as a reference for sharing across team members (the `.env.dev` file that ships with Pegasus was .gitignored) - Added Docker-based instructions for running tests while watching for changes. - Add `lang="en"` to base template for improved accessibility ### Fixed - Fixed bootstrap button CSS classes in a few templates to use the `pg-` class styles instead of the legacy Bulma version. (thanks Lisa for reporting) - Removed unreachable template code in `view_subscription.html`. - Removed accidental references to teams from user-based subscription views. - Fixed subscription payment display amount when subscription quantity is > 1 - `URLField` now renders with same styles as other inputs - Don't sync Stripe subscriptions if they don't need to be changed (per-seat billing only) - Don't show hidden labels for inputs in `render_field`/`render_form` tags - Fixed typo in `update_billing_date_on_membership_deletion` doc string ### Changed - **Upgraded Python packages to their latest versions.** - **Heroku-based docker deployments now use a `buster` base image instead of `alpine`. This helps to simplify build issues when adding certain packages / libraries.** - Simplified team-based subscription views to no longer have redundant functions - Improved layout of `socialaccount/signup.html` (shown when someone signs up with a social account but the email is already in use). (thanks Lisa for reporting) - Updated migration file in api app to match latest expected column sizes - `upgrade_subscription_checkout.html` template has been combined with `upgrade_subscription.html` - Upgrade htmx version from 1.5 to 1.7 - Improved error message when running `bootstrap_subscriptions` with bad Stripe credentials - Extracted `get_price_display_with_currency` helper function from `get_friendly_currency_amount` - Increased size of titles in socialaccount templates. - Reduced whitespace in HTML templates that were modified from 4-spaces to 2-spaces. - Added `celerybeat-schedule` to `.gitignore` ### Removed - **The deprecated Stripe elements support for subscriptions has been removed. Subscriptions require using Checkout moving forwards.** *May 30, 2022* ## Version 2022.4.2 This is a hotfix release, which adds a missing closing `` tag to the signup template on Tailwind builds when not using teams. *April 27, 2022* ## Version 2022.4.1 This is a hotfix release, which fixes the `make init` command to start containers in the background so that migrations will properly run. *April 26, 2022* ## Version 2022.4 Version 2022.4 is a mix of new features and maintenance improvements. Major updates include new "Login with Twitter" functionality, allowing users to manage their own social accounts, and some Docker development improvements. ### Added - **Added "login with Twitter" as a first-class supported authentication option.** - **Users can now see and manage (connect and disconnect) social accounts (Google and Twitter) from their profile pages.** - Added new Docker makefile targets, including `make start-bg` to run docker containers in the background (previous default behavior), and `make restart` to restart docker containers - Added view to simulate errors (by raising an Exception). This is helpful for testing Sentry integrations. - Added ability to override page titles in templates using the `{% page_title %}` block. - Added better page titles to several app pages. - Continued adding translation markup in user-facing text that was modified (this will be an incremental effort towards full-site translation) ### Changed - **Upgraded version of node that runs in the Docker container from 14 to 16.** - **Sentry is now a first-class build option enabled in the UI. If enabled, it will be automatically included in requirements and configured in `settings.py`.** - README file now includes Docker-specific instructions for everything that was included (Docker builds only) - Made more settings variables configured via environment variables. - Docker `make start` command now runs in the foreground instead of in the background. - Merged `meta.html` partial template into `base.html` to enable overridding blocks inside of it. - The `socialicon` CSS class is now shared in all CSS frameworks and also sets the max width/height of the icon. - Updated outdated Django docs references to Django 3.2 - Extracted social login buttons to their own templates which are shared on signup and login pages. - Upgraded Django to 3.2.13 ### Fixed - Filter out inactive (archived) Stripe prices/plans from the list of plans ### Removed - Removed `dev-requirements` files. Pip tools should now be installed with `pip install --upgrade pip-tools`. - No longer call `npm install` in the `Dockerfile`, since it wasn't working as expected. - Cleaned up unnecessary `type="application/javascript"` markup from many `