Django tips: Recovering Gracefully From ORM Errors

How do you handle ORM errors in Django? Learn how to make your Django function views more robust with try/except (or with a neat shortcut).

Django: Recovering Gracefully From ORM Errors

Django views are the glue between your users and the underlying database. When a user visits an url Django can map that url with a view. And most of the times the view is also responsible for fetching some data from the database.

Continue reading “Django tips: Recovering Gracefully From ORM Errors”

JavaScript Engines: How Do They Even Work? From Call Stack to Promise, (almost) Everything You Need to Know

A whirlwind tour of JavaScript engines from Call Stack, Global Memory, Event Loop, Callback Queue to Promises and Async/Await! Enjoy the reading!

JavaScript Engines: How Do They Even Work?

Ever wondered how browsers read and run JavaScript code? It seems magic but you can get an hint of what’s happening under the hood.

Let’s begin our immersion in the language by introducing the wonderful world of JavaScript engines.

Continue reading “JavaScript Engines: How Do They Even Work? From Call Stack to Promise, (almost) Everything You Need to Know”

Decoupling Django with Django REST (and a sprinkle of React) @ Pycon Italia 2019

I gave a talk about Decoupling Django with Django REST at Pycon Italia 2019. Here are the slides and the transcript!

Decoupling Django with Django REST (and a sprinkle of React) @ Pycon Italia 2019

It was a pleasure to attend and speak at the tenth edition of Pycon Italia. I gave a talk about Decoupling Django with Django REST. Here’s a loose transcript of the talk which you can use as a tutorial too, alongside with the slides and some pictures!

Continue reading “Decoupling Django with Django REST (and a sprinkle of React) @ Pycon Italia 2019”

JavaScript in the Browser: What is the Document Object Model? What is DOM manipulation?

A quick introduction to the Document Object Model. Learn what is DOM manipulation and how to use the native DOM API to interact with web pages from JavaScript!

JavaScript in the Browser: What is the Document Object Model? What is DOM manipulation?

JavaScript is not that bad. As a scripting language running in the browser it is really useful for manipulating web pages. In this quick guide we’ll see what function we have for interacting and modifying an HTML document.

Continue reading “JavaScript in the Browser: What is the Document Object Model? What is DOM manipulation?”

Back To The Basics: How To Generate a Table With JavaScript (vanilla)

What it takes to generate a table with vanilla JavaScript? Let’s find out in this tutorial!

Back To The Basics: How To Generate a Table With JavaScript (vanilla)

It’s always a good time for refreshing your JavaScript skills: manipulating the DOM with the native API is a topic that comes up a lot in technical interviews.

In the following tutorial we’ll see what it takes to generate a table with vanilla JavaScript, without resorting to any library or framework.

Continue reading “Back To The Basics: How To Generate a Table With JavaScript (vanilla)”

React Hooks Tutorial for Beginners: Getting Started With React Hooks (2019)

In this React hooks tutorial you will learn how to use React hooks, what they are, and why we’re doing it.

React Hooks Tutorial for Beginners: Getting Started With React Hooks (2019)

Here I am, writing a React hooks tutorial for you. I decided to wait until hooks got finally released before dropping this post. Together we’ll learn React hooks step by step, with a look at how the same logic would be implemented with ES6 classes.

Enjoy the reading!

Continue reading “React Hooks Tutorial for Beginners: Getting Started With React Hooks (2019)”