Eduardo Zepeda's latests posts
Periodic Tasks with Celery and Django
- django
In addition to creating asynchronous tasks, celery also allows you to create periodic tasks, which are executed from time to time. This can be quite useful to give maintenance to the database from time to time, to send marketing or shopping cart recovery emails, perhaps even to e...
Read more
Celery and django to run asynchronous tasks
- django
Celery, in combination with Django serve to solve a problem: the lack of asynchrony in our application. Sending an email, processing some file or responding to a third party service will keep our execution waiting for the task to finish and, as a consequence, our user waiting.&#x...
Read more
Login using Django Rest Framework DRF
- django
Almost all complex Django applications need views for Login, Logout, reboot and password change, as well as user registration. However, both Django and Django REST Framework (DRF) are completely agnostic about their implementation, and delegate the responsibility for these functi...
Read more
React memo, useMemo and useCallback to avoid React renderings
- react
We can use react memo and useCallback to prevent a component from being rendered, uselessly, multiple times by memoization. If you don’t know what memoization is or don’t understand what the react components, useCallback and memo are for, I have a post where I explain...
Read more
React useCallback, useMemo and memo, differences
- react
The useCallback, useMemo and memo functions are used to optimize React applications using memoization, avoiding useless renderings, each with their differences, similarities and use cases. These three functions should not be used indiscriminately, but only in those situations whe...
Read more
Mexico Postal codes API with Django
- django
Do you need to get the data associated with a postal code in Mexico for your Django application? I wrote a small library called django-postalcodes-mexico that downloads postal codes from SEPOMEX (México’s Postal Codes official site) and creates an API endpoint that allows y...
Read more
Django and htmx, modern web apps without writing JS
- django
- htmx
The other day I was testing a library called htmx, which promises to make web creation much easier, yes, another library, but with the difference that this one doesn’t need you to write Javascript (JS) and it also combines quite well with Django. Htmx bases all its operatio...
Read more
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
Managers or custom handlers in Django
- django
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
- django
What if a user’s finger slips on the keyboard and types “parfume” instead of “perfume”. We probably don’t want our user to leave the site because he didn’t find any “parfume” on our website. Our website should return the resul...
Read more