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 August 27, 2024 17:09
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 August 11, 2024 10:48
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