Skip to content

Instantly share code, notes, and snippets.

@danielatdattrixdotcom
danielatdattrixdotcom / source_generators.py
Created October 3, 2012 23:20
Source Generator for Django app easy-thumbnails that uses Wand (ImageMagick)
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from PIL import Image as PILImage
from wand.image import Image
# Source Generator for the easy-thumbnails Django application
# https://github.com/SmileyChris/easy-thumbnails
@danielatdattrixdotcom
danielatdattrixdotcom / magento.py
Created July 10, 2012 22:56
Django authentication backend using a Magento API
from django.contrib.auth.models import User
from magento import Customer
import hashlib
import random
# Requires magento - http://pypi.python.org/pypi/magento
# Note proper use of HTTP/HTTPS for your setup
# If you run multiple stores, set STORE_ID and WEBSITE_ID as-needed or adapt to your setup
class Magento: