This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import partial | |
import pydantic | |
import logging | |
from django.contrib.postgres.fields import JSONField | |
from typing import Type, Union, Tuple | |
from django.core.serializers.json import DjangoJSONEncoder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import hashlib | |
import hmac | |
import textwrap | |
# key and salt can be generated via echo $(xxd -g 2 -l 64 -p /dev/random | tr -d '\n') | |
IMGPROXY_KEY='5360fd1a41998f8c568127a3053f26960d69e735530d5e5df9dcb3e4c4dff8cb55b23cf459f94baf7dbda42400d36006b080881187d80f1bb9f52731df6b8b5b' | |
IMGPROXY_SALT='d9a8a7419ca0dd96214a02c29c5f88b835fbb4a9dd788359cc753f9ac18233b52c1bea5cf87257d2e0730c8c8aa88dbd347616cc3cd3dbeb3241356c9392d9cd' | |