Skip to content

Instantly share code, notes, and snippets.

View petehellyer's full-sized avatar

Peter Hellyer petehellyer

View GitHub Profile
@stebunovd
stebunovd / sns.py
Last active July 19, 2024 21:42
SNS webhook signature verification
import base64
import re
from urllib.parse import urlparse
import requests
from M2Crypto import X509
_signing_cert_cache = {}
_cert_url_re = re.compile(
@thismatters
thismatters / 0001_migrate_to_encrypted.py
Last active March 5, 2024 00:07
Migrating existing columns to use django-cryptography
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django_cryptography.fields import encrypt
app_with_model = 'account'
model_with_column = 'User'
column_to_encrypt = 'email_address'
column_field_class = models.CharField