Tag archive for: Flask-RESTPlus

How to use pycrypto, python-qrcode and Flask-RESTPlus to create QR codes that can send encrypted data to an endpoint

If you want to direct someone to a web page without saying a word, then you can use QR codes to do so.

For example, your QR code reader will direct your phone’s browser to visit our home page when you scan the following QR Code:

Techcoil home page QRCode

Given that, you can use QR codes to send HTTP requests to an endpoint of your HTTP server. In addition, you can embed data that you wish to send to the endpoint in the QR codes.

With this in mind, let’s look at how we can use pycrypto, python-qrcode and Flask-RESTPlus to create QR codes that can send encrypted data to an endpoint.

How to solve “No API definition provided” error for Flask-RESTPlus app on Cloud Foundry

When you create an API endpoint that generates a QRCode with Flask-RESTPlus, you may want to deploy it onto Cloud Foundry.

However, when I first tried to do so, I was greeted with a No API definition provided when I accessed the Swagger Api portal page.

qrcodeapp showing No API definition provided

So why is there a “No API definition provided” error for Flask-RESTPlus app on Cloud Foundry?

In case you are facing such a problem, this post discuss how I had managed to solve the “No API definition provided” error for my Flask-RESTPlus app on Cloud Foundry.

How to create an API endpoint that generates a QR Code image, with Python 3 Flask-RESTPlus and python-qrcode

When you have an API endpoint that generates a QR Code image, another device with a QR Code scanner will be able to get the encoded value to perform some action. For example, WhatsApp web generates a QR Code image that encodes a code for WhatsApp app to sign in the user.

So how can you create an API endpoint that generates a QR Code image? With this in mind, let’s look at how we can do so with Python 3 Flask-RESTPlus and python-qrcode.