Django Posts

37 posts tagged with django

Moya Template Language

Moya's template language is a spiritual successor to Django, and Jinja templates. It borrows a number of constructs from both, and adds a few of its own.

There is a slight difference in the syntax in that variables are substituted with ${variable} rather than {{ variable }}, but tags still use the familiar {% tag %} syntax.

Template languages are generally quite extensible, so there is probably nothing that Moya templates can do that Django / Jinja can't (via a plugin or extension), but there are a few things which are I think are more elegant in Moya's templates language (and built-in). I'm going to talk about a few of them in this post.

How often have you written code like this? continue reading…

Introducing Moya Techblog, a Blogging Engine for Coders and Photographers

I've had a blog on my vanity domain for nearly a decade now. For the last 6 years, it has been powered by Django Techblog, which I wrote out of my frustration with syntax highlighting plugins in Wordpress. Techblog has happily served my blog those 6 years, with only minor hiccups when I half-heartedly ported the code to the latest Django.

There was nothing terribly wrong with Django Techblog; it had multiple blogs, tags, search etc., but there were some annoyances that I didn't have the motivation to do much about. The custom markup system I used was clever, but I would often forget the syntax! The support for images was rudimentary and the single-threaded comment system wouldn't notify me of replies. continue reading…

Looking for an experienced Python Developer

My client, WildFoundry, is looking for an experienced Python developer to join us. We work in the field of IoT, and you will get to work with a variety of really cool technologies. Here's the job description:

WildFoundry is seeking a senior Python web application developer on a 8 month contract to help us in the development of the dataplicity Internet-of-Things platform ( You would be expected to work from your home or own office most of the time and very high quality candidates based in Slovakia, Poland and the United Kingdom will be considered.

This is an unbeatable opportunity to work from home, earn excellent rates and join in with fast growing projects. continue reading…

Saving processes and threads in a WSGI server with Moya

I have a webserver with 3 WSGI applications running on different domains (1, 2, 3). All deployed with a combination of Gunicorn and NGINX. A combination that works really well, but there are two annoyances that are only going to get worse the more sites I deploy:

A) The configuration for each server resides in a different location on the filesystem, so I have to recall & type a long path to edit settings. continue reading…

A simple method for rendering templates with Python

I never intended to write a template system for Moya. Originally, I was going to offer a plugin system to use any template format you wish, with Jinja as the default. Jinja was certainly up to the task; it is blindingly fast, with a comfortable Django-like syntax. But it was never going to work exactly how I wanted it to, and since I don't have to be pragmatic on my hobby projects, I decided to re-invent the wheel. Because otherwise, how do we get better wheels? continue reading…

Hiring a Python web application developer

My client is looking to hire a new Python developer, initially for an 8 month contract. It's a home working position, we communicate mostly via Skype / email / gtalk etc. Although we do meet up in meatspace from time to time, so ideally a candidate would be in the London / Oxford area.

You will be working with your truly. The projects I've been working on are in the server side of web-enabled devices. The web interface is written in Django, so you'll need the usual battery of front-end technologies; HTML, CSS, Javascript etc. We have a Twistd server which communicates with devices in the field, that my client produces. In the middle we have dynamic user interface generation from XML. continue reading…

Finding the first bit set with Python

Here's a Python gotcha that I spent some time tracking down. I'm writing it up in the spirit of saving developers a debugging headache in the future.

I had an integer with a single bit set, and I wanted to find the index of that bit. For example, 4 in binary is 00000100. The 1 is at the third position from the right, which should give an index of 2 – since the first position is 0.

You can do this in two ways; either check each bit in turn until you find a 1, or you can use math as a shortcut. I chose the math solution:

Simple right? Finally staying awake in high school maths paid off. So simple that it was the last bit of code I suspected to be broken (spoiler: it was). continue reading…

Virtual currency site in testing phase

I made currency site available for testing today. See my previous post for the back-story, but in essence currency site is a virtual currency platform.

I sometimes object to the word virtual in ‘virtual currency’. Most of the money I possess is not in any physical form; it's merely a number stored in a database somewhere – and transactions occur without any kind of physical objects changing hands. So the word ‘virtual’ seems entirely redundant, since there's is no qualitative difference between virtual and ‘real’ money I can see. The only difference is the level of trust in the system. continue reading…

Making Money with Python

A while back a friend told me about something called community currency, also know as Local Exchange Trading System. The basic idea of which is that people within a geographical area can exchange goods and services with bespoke unit of exchange rather that traditional cash. So, for instance, you could mow a few lawns in exchange for guitar lessons – even if it isn't the guitar teacher's lawn you are mowing. There's no physical currency as such, members of the community currency rely on volunteers to keep track of how much currency they own. I think this is a marvellous idea. It promotes healthy exchanges without the need to muddy things with something as vulgar as cash. But what struck me after a bit of research is how the whole system is in dire need of mechanisation! There's no centralised place to view your ‘account’ or way to do transactions online, and I figured there should be. So that has been my hobby project for the last few months, I've been building such a site which has recently come together to a point where I'd like to gauge how much interest is out there. I haven't even come up with a name yet, so I've been calling it by the rather uninspired moniker of ‘Currency Site’. continue reading…

Django job at Net Communities

Net Communities are looking for a Python/Django developer to work on an in-house project. It's a contract that would require some on-site work, but they would also consider a full-time developer for the right individual.

If you are interested, get in touch with Andy Evans.