Remove Heroku-specific config and documentation

This commit is contained in:
Christopher C. Wells 2022-10-29 18:51:59 -07:00
parent cba4a2babd
commit 65a7e8776c
9 changed files with 9 additions and 129 deletions

View File

@ -50,18 +50,3 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.github_token }} GITHUB_TOKEN: ${{ secrets.github_token }}
REQUIREMENTS: docs/requirements.txt REQUIREMENTS: docs/requirements.txt
# deploy:
# needs: test
# runs-on: ubuntu-latest
# environment:
# name: demo
# url: http://demo.baby-buddy.net
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
# steps:
# - uses: actions/checkout@v3
# - name: Deploy demo
# uses: akhileshns/heroku-deploy@v3.12.12
# with:
# heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
# heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
# heroku_email: ${{ secrets.HEROKU_EMAIL }}

View File

@ -19,8 +19,8 @@ guess work.
## Demo ## Demo
A [demo of Baby Buddy](http://demo.baby-buddy.net) is available on Heroku. A [demo of Baby Buddy](https://demo.baby-buddy.net) is available. The demo instance
The demo instance resets every hour. Login credentials are: resets every hour. Login credentials are:
- Username: `admin` - Username: `admin`
- Password: `admin` - Password: `admin`

View File

@ -1,42 +0,0 @@
{
"name": "Baby Buddy",
"description": "Helps caregivers track baby's habits to learn about and predict needs without (as much) guess work.",
"keywords": [
"baby",
"baby buddy",
"dashboard",
"django",
"infant",
"newborn",
"python",
"self-host"
],
"repository": "https://github.com/babybuddy/babybuddy",
"website": "https://docs.baby-buddy.net",
"buildpacks": [
{
"url": "heroku/python"
}
],
"env": {
"DISABLE_COLLECTSTATIC": {
"description": "Prevent static asset collection.",
"generator": "secret"
},
"DJANGO_SETTINGS_MODULE": {
"description": "A prebuilt configuration for Heroku.",
"value": "babybuddy.settings.heroku"
},
"SECRET_KEY": {
"description": "Used for the auth system.",
"generator": "secret"
}
},
"environments": {
"review": {
"scripts": {
"postdeploy": "python manage.py reset --no-input"
}
}
}
}

View File

@ -2,11 +2,8 @@
!__init__.py !__init__.py
!base.py !base.py
!ci.py !ci.py
!clever-cloud.py
!development.py !development.py
!gitpod.py !gitpod.py
!heroku.py
!production.example.py !production.example.py
!railway.py
!render.py
!test.py !test.py
!clever-cloud.py

View File

@ -1,34 +0,0 @@
import dj_database_url
from .base import *
# Default to not allow uploads.
# Heroku does not support file storage for this functionality.
BABY_BUDDY["ALLOW_UPLOADS"] = bool(
strtobool(os.environ.get("ALLOW_UPLOADS") or "False")
)
# Database
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
DATABASES = {"default": dj_database_url.config(conn_max_age=500)}
# Email
# https://docs.djangoproject.com/en/4.0/topics/email/
# https://devcenter.heroku.com/articles/sendgrid#python
SENDGRID_USERNAME = os.environ.get("SENDGRID_USERNAME", None) # noqa: F405
SENDGRID_PASSWORD = os.environ.get("SENDGRID_PASSWORD", None) # noqa: F405
# Use SendGrid if we have the addon installed, else just print to console which
# is accessible via Heroku logs
if SENDGRID_USERNAME and SENDGRID_PASSWORD:
EMAIL_HOST = "smtp.sendgrid.net"
EMAIL_HOST_USER = SENDGRID_USERNAME
EMAIL_HOST_PASSWORD = SENDGRID_PASSWORD
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_TIMEOUT = 60

View File

@ -4,8 +4,7 @@
*Default:* `True` *Default:* `True`
Whether to allow uploads (e.g., of Child photos). For some deployments (Heroku) Whether to allow uploads (e.g., of Child photos).
this setting will default to False due to the lack of available persistent storage.
## `AWS_ACCESS_KEY_ID` ## `AWS_ACCESS_KEY_ID`
@ -29,9 +28,8 @@ See also: [`AWS_STORAGE_BUCKET_NAME`](#aws_storage_bucket_name)
*Default:* `None` *Default:* `None`
If you would like to use AWS S3 for storage on ephemeral storage platforms like If you would like to use AWS S3 for storage you will need to create a bucket and add
Heroku you will need to create a bucket and add its name. See django-storages' its name. See django-storages' [Amazon S3 documentation](https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html).
[Amazon S3 documentation](https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html).
## `AWS_S3_ENDPOINT_URL` ## `AWS_S3_ENDPOINT_URL`

View File

@ -6,8 +6,8 @@ guess work.
## Demo ## Demo
A [demo of Baby Buddy](http://demo.baby-buddy.net) is available on Heroku. A [demo of Baby Buddy](http://demo.baby-buddy.net) is available. The demo instance
The demo instance resets every hour. Login credentials are: resets every hour. Login credentials are:
- Username: `admin` - Username: `admin`
- Password: `admin` - Password: `admin`

View File

@ -40,30 +40,6 @@ export DJANGO_SETTINGS_MODULE="babybuddy.settings.base"
python3 /app/babybuddy/manage.py clearsessions python3 /app/babybuddy/manage.py clearsessions
``` ```
## Heroku
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://dashboard.heroku.com/new?button-url=https%3A%2F%2Fgithub.com%2Fbabybuddy%2Fbabybuddy&template=https%3A%2F%2Fgithub.com%2Fbabybuddy%2Fbabybuddy)
For manual deployments to Heroku without using the "deploy" button, make sure to
create the following settings before pushing:
```shell
heroku config:set DISABLE_COLLECTSTATIC=1
heroku config:set DJANGO_SETTINGS_MODULE=babybuddy.settings.heroku
heroku config:set SECRET_KEY=<CHANGE TO SOMETHING RANDOM>
heroku config:set TIME_ZONE=<DESIRED DEFAULT TIMEZONE>
```
See [Configuration](../configuration/intro.md) for other settings that can be controlled
by `heroku config:set`.
After an initial push, execute the following commands:
```shell
heroku run python manage.py migrate
heroku run python manage.py createcachetable
```
## Clever Cloud ## Clever Cloud
To deploy on [Clever Cloud](https://www.clever-cloud.com), log in to your To deploy on [Clever Cloud](https://www.clever-cloud.com), log in to your

View File

@ -1 +1 @@
python-3.9.13 python-3.9.15