Kyle Ting

一生想做浪漫极客

What is the Python Global Interpreter Lock (GIL)?

The Python Global Interpreter Lock or GIL, in simple words, is a mutex (or a lock) that allows only one thread to hold the control of the Python interpreter. This means that only one thread can be...

Python 3's Killer Feature: asyncio

A massive debate in the python community about python2/3 has been raging for years. The main reason for python3 to diverge was to provide unambiguous types to handle unicode, strings and bytes (mor...

Points and Vectors

Points and Vectors - 点和向量 几何学的两大基本概念是点和向量,本质上点是空间中的一个位置。 我们用“·”表示点,我们可以在坐标系中,用坐标表示一个点: 例如 对于二维空间,标准坐标系是笛卡儿坐标系。我们在该坐标系中用有序的坐标对表示点。 首先是 X 轴 然后是 Y 轴,这个点在原点右侧两个单位,和下方一个单位处 表示为 (2, -1)。 在三维空间里,我们可以用...

Executing time-consuming tasks asynchronously with Django and Celery

What’s the matter of having time-consuming tasks on the server side? Every time the client makes a request, the server has to read the request, parse the received data, retrieve or create somethin...

Django project optimization guide part II

This is the second part of Django project optimization series. The first part was about profiling and Django settings, it’s available here. This part will be about working with database optimizatio...

Django project optimization guide part I

Django is a powerful framework used in many great projects. It provides many batteries, that speed up development and therefore reduces the price of it. When a project becomes large and is used by ...

Using Factory Boy testing Django Application

Recently I attended a workshop about web security. During these hours I learnt quite a lot but one thing got my attention- JWT. Based on that I decided to write a blog post series about how to use ...

JSON Web Tokens in django application - part III

As we have working application now it’s high time to make it more secure by authenticating users. To do this I will use JSON Web Tokens. JWT in Django Rest Framework There are few packages on pyp...

JSON Web Tokens in django application - part IV

When I started this series I have got one comment from my co-worker that instead of authentication JWT can be used to sign one time links. After reading through the documentation I found that can b...

JSON Web Tokens in django application - part II

In this blog post, I will deal with creating simple Django application for creating tasks using django rest framework. From this blog post, you can learn how to setup basic DRF application. Overv...