Skip to content

Instantly share code, notes, and snippets.

@danielatdattrixdotcom
danielatdattrixdotcom / source_generators.py
Created Oct 3, 2012
Source Generator for Django app easy-thumbnails that uses Wand (ImageMagick)
View source_generators.py
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 Jul 10, 2012
Django authentication backend using a Magento API
View magento.py
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: