- Create virtual env
- Install requirements
pip install -r requirements.txt
- Hook in pre-commit
pre-commit install
- Copy .env.example to .env and fill in the values
- Run
python manage.py migrate
- Run
python manage.py createsuperuser
Get icons from iconoir, make sure to create a normal (black) and light (white) version Size 24 Stroke Width 1.5
To handle HEIC and HEIF images, we need to convert these with Pillow, while we are wrapping the image with pillow it is also probably a good idea to scale the quality back as well. To do this I have made a helper function. Example usage:
from utils.images import convert_and_compress_image
def save(self, *args, **kwargs):
# Convert picture to jpg and compresses it
if self.picture:
name, buffer = convert_and_compress_image(self.picture)
self.picture.save(name, buffer, save=False)
super().save(*args, **kwargs)
If you add a new environment variable to settings, you will also need to add the variable to https://github.com/aaronspindler/Team.Bio/blob/main/.github/workflows/test-and-deploy.yml in the env section
stripe listen --forward-to localhost:8000/billing/webhook
generates a local webhook listener so that you can test stripe webhook