Eduardo Zepeda's latests posts
Full text search and searches with Django and Postgres
- django
Sometimes when we type we make a mistake in a letter, we can repeat it, omit it or change it for another one. That mistake can lead to a series of different results in a web search, or even no results at all. Maybe for a blog it does not represent a threat, but for an ecommerce i...
Read more
Ngrok, your localhost accessible from the internet
- linux and devops
I ran into Ngrok trying to redirect a Mercado Pago payment notification to my localhost, for testing purposes. It worked more or less like this: Mercado Pago gave you a url address to redirect the buyer to make the payment. Once the payment was finished, Mercado Pago would make a...
Read more
How do permissions and its groups work in Django?
- django
When I first learned that Django had a permissions system, many years ago, it seemed rather esoteric, not very useful and easy to replicate, how wrong I was back then. Then I realized that the built-in permissions system was a marvel and saved a lot of code, and was quite robust ...
Read more
Don't make this mistake using arrays in Python
- python
The other day I was solving a kata in codewars , one of the steps of the problem needed a two-dimensional array, in more mundane words: an array of arrays. In Python it is super simple to create a two-dimensional array using the multiplication operator, as if it were numbers.
...
Read more
How to upload multiple images in Django
- django
You probably already know how to upload an image using a Django model, but what if we don’t want to upload one but multiple images?
Django installation First we install Django using pipenv. We will also install Pillow since we will be dealing with images.
pip instal...
Read more
Why should you use Django Framework?
- django
- opinions
Why use Django in a world where everything is Javascript? Is it really worth learning a Python Framework in an ecosystem that insists on Frameworks written in Javascript? Well, I think so, and here are some of the reasons why you should use Django. And, in order not to lose objec...
Read more
Throttling on Nginx
- software architecture
- linux and devops
Ngnix throttling allows us to limit the number of requests to a certain user. This is useful to prevent excessive requests from a user from keeping the system busy. On the other hand, it is also a way to deter brute force password attempts or even DDOS attacks.
If you are loo...
Read more
How to make a switch in Python?
- python
Python 3.10 was announced and it comes with something that many developers were missing from other languages: the switch statement. Yes, that piece of code that evaluates an expression and compares it with multiple cases to decide what to execute. Python did not have it implement...
Read more
5 cool React libraries you should know about
- react
After several weeks posting about Django I wrote a short post about React, about libraries, because man does not live by Python alone. These are some of the libraries that I consider most useful in React. For obvious reasons are excluded React-router, Redux and others too well kn...
Read more
What is Django genericForeignkey for?
- django
You want to use Django to relate one model to another using a foreign key, but the model you want to relate is a different one for each database entry. Django offers a solution to your problem, a generic foreign key called genericForeignKey and the ContentType model, which I talk...
Read more