Is a package
-
Add "django_qr_code" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [ ... 'django_qr_creator', ]
-
Include the django_qr_code URLconf in your project urls.py like this::
path('image/', include('django_qr_creator.urls')),
-
Run
python manage.py migrate
to create the polls models. -
Start the development server and visit http://127.0.0.1:8000/admin/ to create a poll (you'll need the Admin app enabled).
-
Visit http://127.0.0.1:8000/image/data/qr.png to participate in the django_qr_code.
Tested in python 3.6 with Django 2.0
{% load django_qr_creator %}
Load this tags in you html template
{% qr url='google.com' %}
For QR URL
{% qr tel='+56948161822' %}
For QR Tel
{% qr email='test@test.test' %}
For QR Mail
{% qr location='40.7127753,-74.0059728' altitude='15' %}
For QR Location
{% qr sms='+56948161822' message='this is a test' %}
For QR SMS
from django.shortcuts import render
from django_qr_creator import Image
def demo_image(request, param_data=1, extension='png'):
return Image.get_image(
str_data='http://my-site.com/{param_data}'.format(param_data=param_data),
box_size=40,
content_type=extension)