-
How to use Schemathesis to test Flask API in GitHub Actions
It’s been definitely more than a year since I first discovered Schemathesis. I ran it against one API and got overwhelming amount of errors. Recently I re-discovered it again and something just clicked!
I started to implement fuzzy testing for Ibutsu, which is basically an API written in Flask (python).
The application consists of several parts: frontend, backend, worker, postgres and redis. So how can we run it, run fuzzy testing against it and do it all in each PR in GitHub actions?
Continue... -
How to create automatic notifications in AWS SQS when the new object is added to S3 bucket
AWS has great documentation, but I want to document some things that were easy to miss when I configured notifications to Amazon SQS (Simple Queue Service) from S3 (Simple Storage Service) bucket.
To achieve this nice flow of notifications, the first thing to do is:
1. Create S3 bucket.
There are several ways to do it. Probably, the easiest is using AWS console. Navigate to S3 service and click on “Create bucket”.
2. Create SQS queue.
Continue... -
How to fix positioning of dropdowns when using django-autocomplete-light and crispy forms
Django-autocomplete-light library provides a great way to implement select widget with autocomplete feature in Django forms. I used it, and I am very happy with the result. But my form was still pretty ugly and the obvious and popular solution is to fix it with django-crispy-forms library. I love it! It’s easily configurable in the form class, and the only thing in the template to render the form is
{% crispy form %}
. Nice and clean!However, nothing is that easy, right? After adding {% crispy %} tag, my form became messier than ever. Autocomplete selects were totally different from other fields in the form.
This is how the ugly form looks like:
Continue... -
How to create a Django model where only one row can have a specific value
In my Home Inventory app I implemented the model for Measurement and each Item has its own Measurement.
Later I got tired of selecting measurement value for each new item in the UI as in 99% cases I selected “pcs”. I didn’t want to hardcode initial value, so I started to investigate: how to allow only one row to have a specific field value? Or, in my case, how to create a Django model where only one row can have value True?
Continue... -
How to generate a self-signed SSL certificate and use it in Nginx in docker-compose
While implementing barcode scanning using QuaggaJS, I realized that I have to have a secure origin in order for the live scanning feature to work on mobile devices. Exactly, as written in QuaggaJS README file:
The simplest thing to do for the development environment is to generate a self-signed certificate.
Continue... -
How to overlay one HTML element over another using CSS (QuaggaJS barcode scanner)
I was looking for a tool that can help me to implement barcode scanning for my Home Inventory app.
After considering several options, I decided to proceed with the JavaScript library QuaggaJS. In the repository they have examples, including the example of live barcode detection. I slightly modified it and added it to my project. It worked beautifully, except that the barcode locator (rectangle around the detected barcode) was in a completely different place!
Here’s how the problem looks like:
Continue... -
How to select dropdown value based on another dropdown using django-autocomplete-light
I recently fell in love with the Django framework and started to implement an app that I really need – Home Inventory, that helps me to track items at home (mostly food) and use them before the expiry date.
So when I wanted to implement autocomplete for the product name when adding a new item to my inventory, I found an awesome django-autocomplete-light library. It immediately solved my problem but of course I wanted more – select the value of Category dropdown based on the Product name.
Continue... -
How to become a Red Hat Certified Architect (RHCA)
This year I accomplished one of my goals – I became Red Hat Certified Architect (in Infrastructure). To do this, I had to pass 7 Red Hat exams: RHCSA (Red Hat Certified System Administrator), RHCE (Red Hat Certified Engineer) and 5 exams of my choice.
Why? Because I can!
Here’s the strategy I used, and my top tips to pass the exams and earn RHCA.
Continue... -
How to create a backup using rsync
Sometimes I want to create a backup of my data on another server. Or, maybe, copy some data from one place to another efficiently. The easiest thing to do in those cases is often to use a standard command
rsync
.This is a short note on how to create a backup using only
Continue...rsync
command. -
How to create a blog with Jekyll 4 and host it for free on GitHub
Today I want to note down how I created this very blog using GitHub Pages and Jekyll 4 – a static site generator.
Why? Because GitHub uses Jekyll 3.9.0, whereas the current version of Jekyll is 4.2.1, see all Jekyll releases.
To do this I had to go through various sources and here is the complete guide.
Continue...
- •
- 1
- 2