Video is up for my Pycon 2013 tutorial Introduction to SQLAlchemy. For those who want to follow along at home, the full code and prerequisite material is available here: Prerequisite code Slides on Speakerdeck
Testing Dajaxice Views in Django
If you want to test Dajaxice views from the Django test client, this might be your first approach: url = ‘/dajaxice/apps.front.add_vote/’ data = {‘vote’: ‘yes’, ‘primary_key’: ‘1’} response = self.client.post(url, data=data) This doesn’t work for several reasons. First of all, we need to simulate an AJAX request. Therefore the HTTP_X_REQUESTED_WITH header needs to be set. […]
Programming a Perceptron in Python
At HSR, I’m currently enrolled in a course about neural networks and machine learning. One of the simplest forms of a neural network model is the perceptron. Background Information A perceptron classifier is a simple model of a neuron. It has different inputs ($x_1$…$x_n$) with different weights ($w_1$…$w_n$). $$s = sum_{i=0}^n w_i cdot x_i$$ The […]
Python Simple Getty wrapper released!
Keeping up with our efforts to be an active part of the open source community, we are pleased to announce the public release of our Simple Getty wrapper. Python Simple Getty is a basic wrapper to the extensive Getty Images Connect API. In its current state it does not fully implement Connect, but it works […]
LibreQDA public release
A news worthy of The Tryolabs’ Herald: We have just proudly released to the public LibreQDA, a Qualitative Data Analysis tool that we have developed alongside with the Universitat Autónoma de Barcelona and the Universidad de la República Oriental del Uruguay. LibreQDA is what is commonly know in the psychology area as Computer Assisted Qualitative Data […]
Displaying timezone-aware dates with Tastypie
So you have made the decision to use timezone-aware dates and now you are building your cool REST API using Tastypie. Of course timezones are important to your application, so you want to expose them when Tastypie exposes dates in the API. You have a very simple resource that exposes a Django model that has […]
The Story of Pillow
On March 4, 2013 I got an email from the Python Software Foundation On March 4, 2013 I got an email from the Python Software Foundation (PSF): This email notification is being sent to you to inform you of the PSF Board’s decision to fund the facilitation of a Python 3 compatible release of the […]
d3.js and X-Requested-With
Most JavaScript frameworks set the X-Requested-With HTTP Header to XMLHttpRequest when sending non-cross-domain XHR requests. Many web frameworks like Django or Flask use this to detect AJAX requests. Because of issues with X-Requested-With and cross-domain XHR requests, d3.js does not set that header by default. Therefore Django’s request.is_ajax() and Flask’s request.is_xhr() break. In order to […]
Introduction to SQLAlchemy – Pycon 2013
Preparations are just about complete for my upcoming tutorial Introduction to SQLAlchemy. There’s a good crowd of people already attending, and I think registration is still open in case more people want to sign up. But in any case, if you are coming, this year there is prerequisite material, including the software installs as well […]
collectr: Static File Management for All Of Us
A little while ago I wrote a blog post talking about Git hooks. As an example in that post I wrote a post-commit hook that would minify and upload my static files to S3. This has spiralled a little bit out of control since then, and I finally drew the line at maintaining that script. […]
Requests and the HTTP 302 Status Code
I wanted briefly to touch on the behaviour of the Python Requests library when it receives an HTTP 302 message. This has come up a couple of times on GitHub, and has usually been considered a bug, so it’s worth briefly stepping in and explaining what Requests does and why it does it. First, HTTP […]
Nikola — The Best Blog Engine Ever!
I recently found out about Nikola (through Planet Python). It is awesome, even better than Hyde. Why? Right after the break. Why? A lively community and an awesome lead developer, Roberto Alsina. Actively developed (last commit to Hyde was 11 months ago). Easily extensible. Ships with the Bootstrap style, to which I planned to migrate […]
I Love Checkoutmanager and Dotfiles
An ode to my OS X development workstation setup [1] I am big on setting up my development environment, and enjoying the environment I work in. And I’m very thankful to the folks who make my life easier, including the authors of: Python: Python Core Developers dotfiles: Jon Bernard checkoutmanager: Reinout Van Rees I also […]
Pillow Python 3
PIL is on its way to Python 3 via Pillow. Support from Brian Crowell and others has been merged into master here: https://github.com/python-imaging/Pillow/pull/35 And work continues toward a pre PyCon 2013 release! Please help if you can: Ubuntu users, read through https://github.com/python-imaging/Pillow/issues/18 and provide assistance with testing this Ubuntu package: https://launchpad.net/~pythoneers/+archive/ppa. Git experts, please comment […]
Python 3 Porting
The 3 in 2013 is for Python 3 I tend to like projects that everyone else hates, e.g.: Removing persistent Python objects associated with missing classes in ZODB. Making new releases for old software that is still useful but unmaintained. Running flake8 on 10s or 100s of source files and hand-fixing the results. Part of […]