Properly Defining SerializerMethodFields in DRF

I’m currently implementing a RESTful API with Django Rest Framework (a fantastic framework by the way). I’m mostly depending on the automatic serialization that a ModelSerializer provides. class ReportSerializer(serializers.ModelSerializer): class Meta: model = models.Report fields = (‘id’, ‘name’) But sometimes you need extra fields. In my case I wanted to add a readonly image_url field […]

Read More

Python + Elasticsearch. First steps.

Lately, here at Tryolabs, we started gaining interest in big data and search related platforms which are giving us excellent resources to create our complex web applications. One of them is Elasticsearch. Elastic{ON}15, the first ES conference is coming, and since nowadays we see a lot of interest in this technology, we are taking the opportunity to give […]

Read More

Asynchronous Python and Databases

The asynchronous programming topic is difficult to cover. These days, it’s not just about one thing, and I’m mostly an outsider to it. However, because I deal a lot with relational databases and the Python stack’s interaction with them, I have to field a lot of questions and issues regarding asynchronous IO and database programming, […]

Read More

Hyper: The State of the Union

It’s been a few months since I last spoke about hyper. The reason I’ve been so quiet is primarily because not much progress has been made on the project. I’ve been swamped with other projects (most notably Project Calico), and that’s limited my ability to make much forward progress. However, in the last few weeks […]

Read More

New Django Website

After a series of Django gigs in 2014, I had the urge to redevelop our company website in Django; I am very happy with the results. This overview is roughly in order of development from start to finish. And since I am a “packaging guy”, I will take this opportunity to comment on miscellaneous packaging […]

Read More

Pillow Runs Itself

As of Pillow 2.6.0, the Pillow project almost completely runs itself! Of course when I say “runs itself” I mean “runs without me”, which is what every open source project lead hopes for. For the first time ever, I was able to: Turn off GitHub Watching until two weeks before the release. Not run setup.py […]

Read More

A Fresh Look at Rust

I have been programming with Rust for quite a long time now but that does not mean much. Rust has been changing for years now in such dramatic ways that coming back after two months feels almost like working in a different language. One thing however never changed: the trajectory. With every update, with every […]

Read More

Profiling Pytest Tests

If you want to run a profiler over your pytest cases (including underlying code), the easiest way is to run pytest directly using cPython: python -m cProfile -o profile $(which py.test) You can even pass in optional arguments: python -m cProfile -o profile $(which py.test) tests/worker/test_tasks.py -s campaigns This will create a binary file called […]

Read More