Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
.. contents::
Django QR is a simple Django application that provides some templatetags that allows to include automatically QR codes on the Django site.
Once is installed from PyPI, you just need to add it to your settings as 'qrcode':
::
INSTALLED_APPS = (..., 'qrcode', ...)
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:
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
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',
}
Another templatetag can be used to render a QR-code that links to a Django object URL. As the previous templatetags, the usage is very simple:
:: {% qr_from_object object "size" %}
Where:
By default, django-qr uses Google Chart for generating the QR-code. But this can be changed with a new template. The default template qrcode/qr_tag.html contains the following:
::
But if you want to use some other service, like qrserver, you just need to add a new template in your templates dirs with the following code:
::
The idea is that your qrcode/qr_tag.html contains an img tag and the call to the service that you want, mantaining the variables size and data.
FAQs
Django application that provides simple templatetags to generate QR-codes
We found that django-qrcode demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.