NotesRecently, a friend asked if I knew of a Web Component that generates a QR Code from meaningful HTML. She said that there seemed to be plenty of options for creating QR codes in general, but none that worked by extending already-useful HTML instead of just configuring it all with JavaScript. I couldn't find any either, but thinking through these kinds of patterns is probably what I enjoy most about working on the web, so I thought I'd write up how I'd make one.Unfurl
NotesThe shadow of this cube in different directions gives QR codes pointing to the Wikipedia articles for Kurt Godel, M.C. Escher, and J.S. Bach respectively. Note that QR codes cannot be read in mirror image, so only 3 of the 6 possible cube orientations cast a readable shadow.FeedUnfurl
NotesCreating QR codes is a quick and easy process using a few model signals and the PyQRNative port. The hardest part of this implementation was finding a way to use the Django ContentFile object to save the generated QR code using our selected storage backend. This was important because you would not have to worry about changes to your system architecture effecting your QR generation code. An example would be moving from local filesystem storage to S3 using Django Storages (django-storages).Unfurl