Eduardo Zepeda's latests posts
Django Rest Framework and JWT to authenticate users
- django
- javascript
JWTs (JSON Web Tokens) have become extremely popular, some even consider them a replacement for the classic tokens used by other frameworks, such as the Django Rest Framework. Using JWT or regular tokens (SWT) allows you to store all your session information directly on the token...
Read more
How to create a custom manager django?
- django
- databases
A Manager (or handler) is the interface through which query operations or queries from the database are provided to Django models. Yes, I mean that objects that goes after the name of your model; YourModel.objects.all() and Tumodel.objects.filter(). All Django models have at leas...
Read more
Trigrams and advanced searches with Django and Postgres
- django
- databases
What if a users finger slips on the keyboard and types parfume instead of perfume. We probably dont want our user to leave the site because he didnt find any parfume on our website. Our website should return the results that most closely match what they are looking for. See how a...
Read more
Full text search and searches with Django and Postgres
- django
- databases
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
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.arr =...
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 dont want to upload one but multiple images in Django Framework?Django installationFirst we install Django using pipenv. We will also install Pillow since we will be dealing with images.pip inst...
Read more
Why should you use Django Framework?
- django
- opinion
Why to use Python Framework like Django in a world where everything is Javascript? Is it really worth learning such 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 or...
Read more
Throttling on Nginx
- software architecture
- linux
(adsbygoogle = window.adsbygoogle || []).push({}); .nc { margin: 2rem 0; } .banner{ width: 728px; height: 90px; } .google-ads-container-8672022193{ background-color: transparent; width: 100%; height: 90px; } @media (max-width: 720px) { ...
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