Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
.. 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.