It’s time to have a conversation, folks. At PyCon AU this year, Russell Keith-Magee just gave an extremely interesting talk about the difficulty of funding OSS sustainably. I recommend watching that talk before reading the rest of this post if you have the time. Russell’s talk ends with something of a call to arms: he […]
Category: Django
Asynchronous Tasks with Django and Celery
When I was new to Django, one of the most frustrating things I experienced was the need to run a bit of code periodically. I wrote a nice function that performed an action that needed to run daily at 12am. Easy, right? Wrong. This turned out to be a huge problem to me since at […]
Let LoopBack Do It: A Walkthrough of the Node API Framework You’ve Been Dreaming Of
While Ruby has Rails and Python has Django, the dominant application development framework for Node has yet to be established. But, there is a powerful contender gaining steam: LoopBack, an open source API framework built by StrongLoop, the creators of Express. Let’s take a closer look at LoopBack and it’s capabilities by turning everything into […]
Django Development with Docker Compose and Machine
Docker is a containerization tool used for spinning up isolated, reproducible application environments. This piece details how to containerize a Django Project, Postgres, and Redis for local development along with delivering the stack to the cloud via Docker Compose and Docker Machine. In the end, the stack will include a separate container for each service: […]
Fun with Django’s New Postgres Features
This blog post covers how to use the new PostgreSQL-specific ModelFields introduced in Django 1.8 – the ArrayField, HStoreField, and Range Fields. This post is dedicated to the awesome backers of this Kickstarter campaign put together by Marc Tamlyn, the true playa that made it happen. Playaz Club? Since I’m a huge geek and have […]
Creating Django Oscar Initial Data Migration
I’m working on an online shop for our local hackerspace Coredump. To implement it, we chose django-oscar because I already know how to deal with Django and because it seems to be very customizeable. In the docs it is mentioned that every shop needs a product class and a fulfillment partner. The proper way to […]
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 […]
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 […]
Migrating from django-social-auth to python-social-auth
I recently ported an app with Google OAuth2 integration from django-social-auth to python-social-auth. Here are some things I noticed that were not mentioned in the porting docs. (Note: In the following text I will refer to django-social-auth and python-social-auth as DSA and PSA in order to keep my typing sanity.) Migrating Database Last week I […]
Django, Flask, and Redis Tutorial: Web Application Session Management Between Python Frameworks
I love and use Django in lots of my personal and client projects, mostly for those involving relational databases and more classical web applications. However, by design, Django is very tightly coupled with its ORM, Template Engine System, and Settings object. Plus, it’s not a new project: it carries a lot of baggage from the […]
Plot Registered Django Users with Matplotlib
Sometimes you want to see the number of registered users in your Django website over time. Fortunately Django stores the registration date of a user model instance in the date_joined field, so we can plot it. Prerequisites You need an installation of numpy and matplotlib. You can install the libraries using pip: $ pip install […]
Control Your Laptop with an Android Phone using Python, Twisted, and Django
It’s always fun to put your programming skills on display. A while back, I figured it’d be cool to try and control my laptop via my Android mobile device. Think about it: being able to play and pause music, start and stop programming jobs or downloads, etc., all by sending messages from your phone. Neat, […]
Big Redesign Time
I first posted in this blog 14 months ago. In the history of humanity, that’s not all that long ago, but for me it feels like an age. When I wrote that original blog post, I was still at university (just). I knew I was going to be a software engineer, but didn’t have much […]
Writing A Persona Identity Provider
As I said in my last post, I recently added Persona Identity Provider functionality to this blog. If you follow me on Twitter (and really, why wouldn’t you?), you might have noticed that this wasn’t an entirely smooth process. Mozilla are a great organisation, and there are lots of great developers working on the Persona […]
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. […]