diff --git a/ai.md b/ai.md index 2ef0b8d..01e5ed2 100644 --- a/ai.md +++ b/ai.md @@ -20,7 +20,7 @@ We recommend choosing "OpenAI" unless you know you want to use a different model ### Configuring OpenAI If you're using OpenAI, you need to set `OPENAI_API_KEY` in your environment or settings file (`.env` in development). -You can also change the model used by setting `OPENAI_MODEL`, which defaults to `"gpt-3.5-turbo"`. +You can also change the model used by setting `OPENAI_MODEL`, which defaults to `"gpt-4o"`. See [this page](https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key) for help finding your OpenAI API key. @@ -33,7 +33,7 @@ values in your `settings.py`. For example: ```python LLM_MODELS = { "gpt-3.5-turbo": {"api_key": env("OPENAI_API_KEY", default="")}, - "gpt4": {"api_key": env("OPENAI_API_KEY", default="")}, + "gpt-4o": {"api_key": env("OPENAI_API_KEY", default="")}, "claude-3-opus-20240229": {"api_key": env("ANTHROPIC_API_KEY", default="")}, "ollama_chat/llama3": {"api_base": env("OLLAMA_API_BASE", default="http://localhost:11434")}, # requires a running ollama instance } diff --git a/code-structure.md b/code-structure.md index 956fc15..27d5209 100644 --- a/code-structure.md +++ b/code-structure.md @@ -83,7 +83,9 @@ The majority of the project's base template layouts are in the `templates/web` f ## Code formatting For projects that have enabled the `Autoformat code` option, the code will have been formatted -using [black](https://black.readthedocs.io/en/stable/) and [isort](https://pycqa.github.io/isort/). +using [ruff](https://github.com/astral-sh/ruff)—a drop-in replacement for +[black](https://black.readthedocs.io/en/stable/) and [isort](https://pycqa.github.io/isort/) that runs +much faster than those tools. The project will also include [pre-commit](https://pre-commit.com/) as a dependency in the requirements file as well as the `.pre-commit-config.yaml` file in the root directory. pre-commit is a tool for managing pre-commit @@ -96,19 +98,18 @@ $ pre-commit install --install-hooks pre-commit installed at .git/hooks/pre-commit ``` -The default configuration that ships with Pegasus will run `isort` and `black` prior to every Git +The default configuration that ships with Pegasus will run `ruff` and `ruff-format` prior to every Git commit. If there are fixes that are needed you will be notified in the shell output. ### pre-commit Usage **Manually running hooks** + ```shell # run all hooks against currently staged files pre-commit run # run all the hooks against all the files. This is a useful invocation if you are using pre-commit in CI. pre-commit run --all-files -# only run the isort hook against all staged files -pre-commit run isort ``` **Temporarily disable hooks** @@ -120,27 +121,16 @@ For more information on using and configuring pre-commit check out the ### Tool configurations -The configuration for the tools can be found in the [`pyproject.toml`][toml] file. - -[toml]: https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#what-on-earth-is-a-pyproject-toml-file -**isort** +The configuration for the tools can be found in the [`pyproject.toml`][toml] file, using the same syntax as `black`. -| Parameter | Value | -|--------------|---------| -| Filter Files | `true` | -| Profile | `black` | -| Line Length | `120` | - -[iSort docs](https://pycqa.github.io/isort/docs/configuration/options) - -**black** +[toml]: https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#what-on-earth-is-a-pyproject-toml-file -| Parameter | Value | -|--------------|---------| -| Line Length | `120` | +For the most part the default black/ruff formats have been preserved, with a few updates, for example, +increasing the line length to 120. -[Black docs](https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html) +You can find more information about these values in the +[ruff README](https://github.com/astral-sh/ruff?tab=readme-ov-file#configuration). ### Upgrading diff --git a/configuration.md b/configuration.md index 47fc403..cd205cc 100644 --- a/configuration.md +++ b/configuration.md @@ -106,8 +106,11 @@ The domain name of this `Site` will be used for your server address. If you need to change the URL after installation, you can go to the site admin at `admin/sites/site/` and modify the values accordingly, leaving off any http/https prefix. -In development you'll typically want a domain name of `localhost:8000`, and in production this should +In development, you'll typically want a domain name of `localhost:8000`, and in production this should be the domain where your users access your app. +Note that this URL must match *exactly* what is in the browser address bar. +So, for example, if you load your development site from `127.0.0.1:8000` instead of `localhost:8000` then +that is what you should put in. **Example Development Configuration** @@ -281,6 +284,20 @@ For help configuring LLMs and AIs, see the [AI docs](./ai.md). See the [celery docs](/celery) for set up and configuration of Celery. +## Turnstile + +To enable support for [Cloudflare Turnstile](https://www.cloudflare.com/products/turnstile/), +set `TURNSTILE_KEY` and `TURNSTILE_SECRET` in your settings or environment variables. + +This should automatically enable turnstile on your sign up pages. + +It is recommended to create two different Turnstile accounts on Cloudflare for development and production. +In development you can specify "localhost" as your domain like this: + +![Turnstile Dev](/images/turnstile.png) + +In production, you should replace that with your site's production domain. + ## Mailing List @@ -358,6 +375,12 @@ you to have persistent storage available for your site such as a Docker volume. ### Setting up S3 media storage +*For a video walkthrough of this content (using kamal deployment), see below:* + +
+ This section assumes you have set up your SaaS Pegasus project with the **S3 media file storage** enabled. In order to use S3 for media storage you will need to create an S3 bucket and provide authentication diff --git a/cookbooks.md b/cookbooks.md index 65c0c95..0a25f7e 100644 --- a/cookbooks.md +++ b/cookbooks.md @@ -33,9 +33,9 @@ To migrate a project from non-formatted to formatted code, you can go through th 1. First, do a full Pegasus upgrade to the version you want to update to, as described [here](./upgrading.md). **Do *not* check the "autoformat" checkbox yet.** 2. Next, run the formatting tools on your project's `main` branch: - 1. Install black and isort: `pip install black isort` - 2. Run black: `black --extend-exclude migrations --line-length 120 .` - 3. Run isort: `isort -l 120 --profile black .` + 1. Install ruff: `pip install ruff` + 2. Run ruff linting `ruff check --extend-exclude migrations --line-length 120 . --fix` + 3. Run ruff formatting: `ruff format --line-length 120 .` 3. Commit the result: 1. `git add .` 2. `git commit -m "apply formatting changes"` diff --git a/css/tailwind.md b/css/tailwind.md index 70088c6..364a9e8 100644 --- a/css/tailwind.md +++ b/css/tailwind.md @@ -87,6 +87,28 @@ daisyui: { ## Other products / themes +### Flowbite + +[Flowbite](https://flowbite.com/) is a library with many great UI components---most of which are free and open source. + +Flowbite can easily be added to a Pegasus project by installing it via `npm` and adding it to your global `site.js` and +`tailwind.config.js` files. + +You can use [this git patch file](https://gist.github.com/czue/73cec7ff562aff0943e55538fe9b4550#file-flowbite-patch) +as a starting point and apply it to your project by running: + +``` +git apply flowbite.patch +``` + +This demonstrates basic installation and enabling the [datepicker plugin](https://flowbite.com/docs/plugins/datepicker/). + +After applying the patch you will need to run `npm install` and `npm run dev-watch` to enable it on all pages. + +If you build with the Pegasus examples, you should be able to see the datepicker at [http://localhost:8000/pegasus/forms/](http://localhost:8000/pegasus/forms/). + +### Tailwind UI + [Tailwind UI](https://tailwindui.com/) is a great product for building more complex pages, including marketing sites and app UIs. It another great option for getting help with UI components and pages, and should integrate seamlessly with the current Pegasus templates. diff --git a/deployment/kamal.md b/deployment/kamal.md index d6bebb6..3114f6e 100644 --- a/deployment/kamal.md +++ b/deployment/kamal.md @@ -40,10 +40,9 @@ We'll walk through these in more detail in order below. The first step is to provision a server were you will host your application. Some popular choices include: -1. Digital Ocean Droplets (you can sign up with [this link](https://m.do.co/c/432e3abb37f3) to get $100 credit -and help support Pegasus). -2. [Linode](https://www.linode.com/). -3. [Hetzner](https://www.hetzner.com/). +1. Hetzner (get €20 credit and support Pegasus with [this link](https://hetzner.cloud/?ref=49vhF1w3TIyB)). +2. Digital Ocean Droplets (get $100 credit and support Pegasus with [this link](https://m.do.co/c/432e3abb37f3)). +3. [Linode](https://www.linode.com/). 4. [AWS](https://aws.amazon.com/) (Lightsail or EC2). 5. [Google Cloud](https://cloud.google.com/). 6. [Microsoft Azure](https://azure.microsoft.com/en-us). @@ -496,3 +495,17 @@ In your repositories settings page, go to the "Secrets and variables -> Actions" With these secrets set, the GitHub Actions workflow will be able to deploy your app to Kamal. To test it go to the "Actions" tab in your repository, click on the "Kamal Deploy" workflow, and then click "Run workflow". + +### Cookbooks + +#### Changing your site URL + +To change your site's URL, do the following: + +1. Set up a new DNS endpoint as outlined above. +2. Change all ``Host(`example.com`)`` values in your traefik configuration in `deploy.yml` to the new domain. +3. Update your `ALLOWED_HOSTS` setting / environment variable as needed. +4. Run `kamal traefik reboot`. +4. Run `kamal deploy` + +Your app should now be running on your new domain. diff --git a/deployment/production-checklist.md b/deployment/production-checklist.md index 18c828e..bdd77b1 100644 --- a/deployment/production-checklist.md +++ b/deployment/production-checklist.md @@ -51,6 +51,7 @@ Ensure that you have configured the following variables (if you are using them): `STRIPE_LIVE_PUBLIC_KEY`, and `STRIPE_LIVE_SECRET_KEY` config vars (or whatever subset you are using). - If you set up email, ensure whatever keys/secrets you need are set. - If you're using Mailchimp, set `MAILCHIMP_API_KEY` and `MAILCHIMP_LIST_ID`. +- If you're using Health Checks, set `HEALTH_CHECK_TOKENS`. Refer to your [chosen platform's documentation](/deployment.rst) for details on how to set environment variables in that platform. @@ -77,6 +78,21 @@ There is guidance on configuring media files in the [settings and configuration The most common choice of external storage is [Amazon S3](https://aws.amazon.com/s3/), though many cloud providers have their own S3-compatible options, e.g. [Digital Ocean Spaces](https://www.digitalocean.com/products/spaces). +## Check your static file setup + +By default, Pegasus uses [whitenoise](https://whitenoise.readthedocs.io/en/stable/index.html) for static files. +**If you keep the default setup, you do not need to change anything.** +Static files will be built and collected as part of the build process of your Docker container and should be available +on your production site. + +If you decide to switch to serving files externally, for example, using Amazon S3, +then you may need to modify your static file set up for some platforms. +This is because production secrets necessary to save files to S3 may not be available during the Docker container build. + +If this is the case, you should modify your deployment set up so that `python manage.py collectstatic --noinput` is run +at the same time as Django database migrations, so that the necessary secrets are available to the application. +The exact way to do this will vary by deployment platform. + ## Optimize your front end The front-end files that ship with Pegasus are the developer-friendly versions. @@ -94,7 +110,7 @@ The platform-specific docs have some guidance on setting this up where possible. ## Update other configuration options See [the configuration page](/configuration.md) for a larger list of options, -including social login, sign up flow changes, analytics, logging, and so on. +including social login, sign up flow changes, analytics, logging, adding captchas, and so on. ## Set up monitoring @@ -104,7 +120,18 @@ see any errors that are encountered. It's also recommended to enable the health check endpoint and connect it to a monitoring tool like [StatusCake](https://www.statuscake.com/) or [Uptime Robot](https://uptimerobot.com/) so that you can be alerted whenever your site or services are having an outage. -The URL you should connect is: yourdomain.com/health/. +The URL you should connect is: `yourdomain.com/health/`. + +If you have the "Health Check Endpoint" option enabled for your project you should also ensure that +you have set the `HEALTH_CHECK_TOKENS` environment variable to a secure value. This can be a comma-separated +list of tokens that are required to access the health check endpoint: + +``` +yourdomain.com/health/?token=your_secret_token +``` + +You can then use this URL with the monitoring tool to ensure that only your monitoring tool can +access the health check endpoint. ## Double-check your language settings diff --git a/front-end.md b/front-end.md index 9d5ba94..016922c 100644 --- a/front-end.md +++ b/front-end.md @@ -120,7 +120,7 @@ Pegasus has a few patterns for dealing with this. There are two "site-wide" JavaScript files used in Pegasus. The `site.js` file contains code that you want loaded *on every page*. -It's bundle file (`site-bundle.js`) is included in your `base.html`. +Its bundle file (`site-bundle.js`) is included in your `base.html`. This is a good place to put global code, library imports, etc. which should always be available. The `app.js` file contains code that you want loaded *on some pages---typically after login. diff --git a/images/turnstile.png b/images/turnstile.png new file mode 100644 index 0000000..b56b4dc Binary files /dev/null and b/images/turnstile.png differ diff --git a/release-notes.md b/release-notes.md index 234dc6f..f17ece3 100644 --- a/release-notes.md +++ b/release-notes.md @@ -3,6 +3,221 @@ Version History and Release Notes Releases of [SaaS Pegasus: The Django SaaS Boilerplate](https://www.saaspegasus.com/) are documented here. +## Version 2024.8 + +This is largely a maintenance release with many smaller updates and fixes. + +### Added + +- **Added test cases for subscription decorators, feature gating, and views.** + These can be extended/adapted to test custom subscription logic. + Also added utility functions to create test products, subscriptions and mock requests. +- Added a test that will fail if your project is missing any database migrations. + [More on this concept here](https://adamj.eu/tech/2024/06/23/django-test-pending-migrations/). +- **Added an example landing page to Tailwind builds, based largely on [Scriv's landing page](https://scriv.ai/).** +- Added `TURNSTILE_KEY` and `TURNSTILE_SECRET` to Kamal's default secrets. +- Added a section on configuring static files to the [production checklist](./deployment/production-checklist.md). + +### Changed + +- **Code is now automatically formatted for all projects.** + The "Autoformat code" check box has been renamed to "Enable linting and formatting" and now only controls whether + `ruff` and the pre-commit hooks are included in the project download. + Projects that had already enabled auto-formatting are unaffected by this change. (See upgrade notes below.) +- **The example landing pages are now used as the project's landing page instead of being listed in the examples**. + (Bulma and Tailwind builds only.) +- **Team invitation emails are now better styled, matching the same format as account emails.** (Thanks EJ for the suggestion!) +- The `EMAIL_BACKEND` setting is now configurable via an environment variable. + Also, added a commented-out example of how to set email settings for a production email provider (Mailgun). +- Apt and pip packages are now cached across Docker builds, which should result in faster build times after the first build. + (Thanks Tobias for the suggestion!) +- Improved the display format of "role" in the team invitation list. (thanks Andy for the suggestion!) +- Change `user/` to `YOUR_GITHUB_USERNAME/` in the Digital Ocean `app-spec.yml` file to make it more obvious that + it should be edited. (Thanks Stephen for suggesting!) +- Changed the UI of social logins on the "sign in" page to match that of the "sign up" page on the Material Bootstrap theme. + This makes the implementation more extensible and more consistent with other CSS frameworks. +- **Upgraded all Python packages to the latest versions.** + +### Fixed + +- Fixed a bug where the formatting `make` targets were still calling `black` and `isort` instead of `ruff`. + `make black` is now `make ruff-format` and `make isort` is now `make ruff-lint`. +- Fixed a bug where the sign up view tests would fail in your environment if `settings.TURNSTILE_SECRET` was set. + (Thanks Finbar for reporting!) +- Fixed translations on the user profile form field names. +- Removed `svg` as an option for profile picture uploads, to prevent the possibility of using it as an XSS attack vector. + ([More info on this threat here](https://medium.com/@rdillon73/hacktrick-stored-xss-via-a-svg-image-3def20968d9)). +- Disable debug toolbar in tests, which fixes test failures under certain conditions. +- Bumped the Postgres version used by Digital Ocean deployments from 12 to 16. + Digital Ocean has deprecated support for version 12. (Thanks Stephen for reporting!) +- Simplified how the list of social login buttons is rendered, and make social login buttons work when + configuring social applications in settings (previously buttons only showed up if you configured apps in the database). + See upgrade note below. + +### Removed + +- Deleted the "sticky header" html and CSS code that was only used on the example landing pages. + +### Upgrade Notes + +- If you had **not** been using auto-formatting until now, you should first follow the instructions for +[migrating to auto-formatted code](./cookbooks.md#migrating-to-auto-formatted-code) prior to upgrading to this release. +Otherwise you will likely get a lot of formatting-related merge conflicts when trying to upgrade. + - If you already enabled auto-formatting (most projects), you don't need to do anything. +- If you had previously configured allauth social applications in the database *and* in your settings file, +you may see a duplicate "Login with XXX" button on the sign up and login pages. +To fix this, remove the social application from either your settings or the database. + +*August, 7, 2024* + +## Version 2024.6.1 + +This is hotfix release that addresses a few issues from yesterday's update: + +- Fix app styles accidentally being purged during the Docker build process. + This caused styling on Docker-based deployments for tailwind builds. (Thanks Steve for reporting!) +- Moved channels url import to after Django initialization. + This fixes an `AppRegistryNotReady` error when deploying asynchronous apps with the AI chat app enabled. + (Thanks Roman for reporting!) +- Don't create the periodic task to sync subscriptions unless per-unit billing is enabled. + +*June 6, 2024* + +## Version 2024.6 + +This is a feature release with a few big updates and a lot of smaller ones. + +### AI model changes + +The library used for non-OpenAI LLMs has been changed from [`llm`](https://github.com/simonw/llm) +to [`litellm`](https://docs.litellm.ai/docs/). Reasons for this change include: + +- It has far fewer additional dependencies. +- It supports async APIs out of the box (for most models). +- The `llm` library is more targeted for the command line use-case, whereas `litellm` offers similar functionality + as a native Python library with a cleaner API. + +Litellm can still be used with all common AI models, including OpenAI, Anthropic/Claude, and local models +(via ollama). For details on getting started with `litellm` see the updated [AI documentation](./ai.md). + +### Formatting and linting now use Ruff + +Black and isort have been replaced with [ruff](https://github.com/astral-sh/ruff)---a Python linter/formatter +that offers the same functionality as those tools but is much faster. + +Additionally, Pegasus will now remove unused imports from your files automatically, both +when building your project and if you have set up `pre-commit`. + +This change should be a relatively seamless drop-in replacement, though you may see some new lint errors +in your projects which you can choose to address. + +### Spam prevention updates + +There has been a dramatic increase in spam-bots over the last month. +Many of these bots target seemingly-innocuous functionality like sign up and password reset forms. + +This version includes a few updates to help combat these bots. +First, you can now easily add [Cloudflare turnstile](https://www.cloudflare.com/products/turnstile/) to your sign up forms, +which will present the user with a captcha and should help reduce bot sign-ups. +See [the turnstile documentation](./configuration.md#turnstile) for information on setting this up. + +Additionally, the `ACCOUNT_EMAIL_UNKNOWN_ACCOUNTS` setting has been set to `False` by default. +This prevents "forgot password" and "magic link" emails from being sent out to unknown accounts. +It should also help reduce unnecessary email sending. + +Finally, the [admin dashboard](#admin-dashboard) no longer shows users with unconfirmed email addresses if you have set +`ACCOUNT_EMAIL_VERIFICATION = 'mandatory'`. +This helps filter out likely bots from the report to provide clearer visibilty of people actually signing up for your app. + +### Complete changelog + +Below is the complete set of changes in this release. + +#### Added + +- **Added configurable captcha support on sign up pages, using [Cloudflare turnstile](https://www.cloudflare.com/products/turnstile/).** + See [the turnstile documentation](./configuration.md#turnstile) for more information on setting this up. (Thanks Troy, Jacob, Robert and others for suggesting.) +- Added API views for two-factor authentication, and to change the logged-in user's password. (Thanks Finbar for suggesting!) +- Add UI to tell users they need a verified email address prior to setting up two-factor auth. + - Also added a `has_verified_email` helper class to the `CustomUser` model. +- Added tests for the delete team view for both team admins and members. (HTMX builds only) +- Added test for team member removal permissions. +- Add display and sort on the number of active members in the teams admin. + +#### Fixed + +- Fixed a bug where team names longer than 50 characters could cause a crash during sign up. +- Fixed a bug where multi-factor authentication QR codes had a dark background when dark mode was enabled (Tailwind builds only). + (Thanks Artem for reporting!) +- Fixed a bug where it was possible to bypass two-factor-authentication when using the API authentication views. + (Thanks Finbar for reporting and helping with the fix!) +- Fixed a bug where deleting the user's only team while impersonating them resulted in a temporary crash. + (Thanks EJ for reporting!) +- Fixed a bug where creating an API key crashed if your user's first + last name combined to more than 40 characters. + (Thanks Luc for reporting!) +- Improved the UI feedback when LLMs fail (e.g. if your API key is wrong or ollama is not running). +- Removed the `static/css` and `static/js` directories from the `.dockerignore` file so that other project files + can be included in these directories. + Also updated the production Docker build process so that any existing files are overwritten + by the built versions. (Thanks Raul for reporting!) +- Made some performance improvements to the production Dockerfile build (don't rebuild the front end if there are + no changes in the dependent files). +- Better support trialing subscriptions with no payment methods. + The subscription UI will now show the date the trial ends and won't log errors about missing invoices. (Thanks Jarrett for reporting!) + +#### Changed + +- **Upgraded all Python packages to the latest versions.** +- **Upgraded all JavaScript packages to the latest versions.** +- **Non-OpenAI builds now use `litellm` instead of `llm`.** See above. (Thanks Sarthak for the suggestion!) +- **Changed the formatter/linter from `black` and `isort` to [ruff](https://github.com/astral-sh/ruff).** See above. + - Also addressed a handful of minor linting errors that came up as a result of this change. + - Codebase linting is now substantially faster. + - Unused imports are now automatically removed when building your projects. +- **Celerybeat now uses the `django-celery-beat` library to store tasks in the database instead of on the filesystem.** + This improves support for celerybeat on Docker-based platforms. (Thanks Peter and Artem for the suggestion!) + - Also added a migration to save the default scheduled tasks in the database. +- The login API response has changed, to allow for two-factor auth prompts, and more machine-readable status fields. +- Removed the no-longer-used `use_json_field=True` argument from wagtail `StreamField`s. +- The admin dashboard no longer shows users with unconfirmed email addresses if you have set `ACCOUNT_EMAIL_VERIFICATION = 'mandatory'`. +- The admin dashboard now includes sign ups from the current date, by default. +- Changed behavior when team role checks fail from raising a `TeamPermissionError` to returning a 403 response, + and updated affected tests. One side effect of this is that the stack traces are removed from successful test runs. +- Secret keys should no longer change every time you build your Pegasus project. + They are also now clearly prefixed with `django-insecure-` to indicate that they should be changed in production. +- Updated the default OpenAI chat model to gpt-4o. +- Upgraded the openapi client generator to version 7.5.0 and also pinned the version used by `make build-api-client` + to the same one. +- Team IDs are now optional on the create team page (HTMX builds only). +- Add clearer error message when charts are broken due to api config issue. (Thanks Yngve for reporting!) +- Added `assume_scheme="https"` to form `URLField`s to be compatible with Django 6 behavior. +- Added `FORMS_URLFIELD_ASSUME_HTTPS = True` to be compatible with Django 6 behavior. +- Set `ACCOUNT_EMAIL_UNKNOWN_ACCOUNTS = False` by default, so that "forgot password" emails do not get sent to unknown accounts. + This can help prevent spam bots. + +#### Removed + +- Removed `black` and `isort` from dev-requirements, since they have been replaced by `ruff`. +- Removed `llm` library and associated code, since it has been replaced by `litellm`. +- Removed no longer used `TeamPermissionError` class. + +#### Standalone front end + +The following changes affect the experimental [standalone front end](./experimental/react-front-end.md): + +- **The standalone React front end now supports two-factor-authentication.** +- Improve the UI when you have login issues in the standalone React front end. + +*June 5, 2024* + + +## Version 2024.5.3 + +This is a hotfix release that fixes a bug where the landing and dashboard page image was accidentally +removed if you built without the examples enabled. + +*May 21, 2024* + ## Version 2024.5.2 This is a hotfix release that fixes a bug that prevented the team management page @@ -49,6 +264,9 @@ and Celery workers and returns a non-200 response code if there are any identifi These endpoints can be connected to a monitoring tool like [StatusCake](https://www.statuscake.com/) or [Uptime Robot](https://uptimerobot.com/) so that you can be alerted whenever your site is having issues. +See the section on [monitoring](./deployment/production-checklist.md#set-up-monitoring) in the +production checklist for more information. + ### Allauth updates The [django-allauth](https://docs.allauth.org/en/latest/) library was updated to the latest version, @@ -3426,4 +3644,3 @@ Documentation for subscriptions can be [found here](/subscriptions). ## Version 0.4 and earlier Release notes for earlier versions are no longer publicly available. - diff --git a/subscriptions.md b/subscriptions.md index 501cae6..6316d5a 100644 --- a/subscriptions.md +++ b/subscriptions.md @@ -89,6 +89,14 @@ If you've set things up correctly you should see a page that looks like this ### Using the embedded Stripe pricing table +The following 5-minute video walks through setting up an embedded pricing table in your project. + + + +Here are the detailed instructions: + If you are using the Stripe embedded pricing table, then all customization happens within the Stripe dashboard. You can change the products, names, descriptions, images, and features by editing the products in Stripe with the desired changes. You can also change the color scheme and other options. @@ -138,7 +146,8 @@ for subscription management after subscription creation. To set up the portal, it's recommended you follow along with [Stripe's integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal). -To use the portal you will also need to set up webhooks as per below. +**To use the portal you will also need to set up webhooks as per below. +Updates made in the portal will not show up if webhooks are not running.** Pegasus ships with webhooks to handle some common actions taken in the billing portal, including: diff --git a/upgrading.md b/upgrading.md index c7138a7..08b9b48 100644 --- a/upgrading.md +++ b/upgrading.md @@ -20,6 +20,9 @@ You can watch a demo of this set up here: +Note: Whenever you merge Pegasus pull requests you should **use the Github option to "Create a merge commit"**. +Do NOT use "Squash and merge" or "Rebase and merge", as they could prevent future updates from merging cleanly +into your project. ## Manually, using branches