Skip to main content

Django application that provides simple templatetags to generate QR-codes

Project description

Django QR

Information

Django QR is a simple Django application that provides some templatetags that allows to include automatically QR codes on the Django site.

Installation

Once is installed from PyPI, you just need to add it to your settings as ‘qrcode’:

INSTALLED_APPS = (..., 'qrcode', ...)

Usage

Its usage is very simple. You just need to use the templatetag as follows:

{% load qr_tags %}

...

{% qr_from_text "text" "size" %}
or
{% qr_from_mail "mail_address" "size" %}

Where:

  • Size is not mandatory, and defines the dimensions of the QR code as following: ‘s’ (120x120 pixels), ‘m’ (230x230 pixels) and ‘l’ (350x350). Any other option will be ignored and will use ‘m’ as default.

  • qr_from_mail tag just add a simple “mailto:” at the beggining, because some qr scanners can detect that as an email address in order to send it an email.

QR-code for contact information

There’s also a templatetag to render a QR-code that allows to store some contact information, such as name, phone number, email address or our company name.

Its usage is similiar to the basics:

{% qr_from contact contact "size" %}

Where:

  • Size is the same as previosly

  • contact should be a Python dictionary (or any other hash structure) that could contain the following elements:

  • name - Complete name

  • phone_number

  • email

  • url - some url address, your blog or personal webpage

  • company

For instance, you could create a contact dictionary like the following:

contact = {
    'name': 'Pablo Recio',
    'phone_number': '00000000',
    'email': 'foo@example.com',
    'url': 'http://www.zocolab.es',
    'company': 'Zocolab',
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-qrcode-0.2.0.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file django-qrcode-0.2.0.tar.gz.

File metadata

File hashes

Hashes for django-qrcode-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3beee68d36157afbb1dbb41458bc4c9fe624eb30126e1564a148d3d8efc2f806
MD5 6d6524265428ee4d75347629cf4fc37f
BLAKE2b-256 31df009f1ecd8012b4e282a792dd4d0ebec781d78aa703cf1ebbc5d776643f6f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page