Category Archives: Programming

Programming

Minimal Django script setup

Notes about python logging

Consider the following code

Executing above: It won’t log anything to console, because it default to level warning It won’t log anything to console, because no stream has been set

Executing above: Running basicConfig(…) default adds the stream to stderr (unless specified explicitly) to root logger It sets the root logger level to… Read More »

Good Read: Being A Developer After 40

“In our industry, every technology generates what I call a “galaxy.” These galaxies feature stars but also black holes; meteoric changes that fade in the night, many planets, only a tiny fraction of which harbour some kind of life, and lots of cosmic dust and dark matter. Examples of galaxies are, for example, .NET, Cocoa, Node.js,… Read More »

Django Rest Framework QuerySet

I have just created this python library so that you can query the remote api just like the Django queryset. It is particularly usefully when used in Django ListView with pagination. https://github.com/variable/django-rest-framework-queryset 

Posting image to thumbor using requests package

Seems like there are not many code sample there, and the requests documentation was giving the wrong hint to use files={‘file’: open(‘image.jpg’)} which you will end up getting 415 response code. I think I will just share my working sample code here to save someone’s time