A web framework for the creative mind

I am timing myself any way and the time starts now. Hello. My name is Mark. I wanted to talk about making the case for Django as the web framework for the creative mind so I like to think of myself as creative, I’m a decent programmer, I’m good, I’ll get on to me and what I do in a tick but that’s the case I wanted to put forward.

Introductions, my name is Mark, I have been a developer since 2001 and like I said I’m an OK programmer but I have lots of different passions I’m interested in, I’m a musician, I write songs, I try and write comedy songs and also make pod casts. In my day job I work for Substract. I am technical director there; I’m in charge of the technical strategy making sure things work and keep running and stuff like that. We’re do you sign led organisation and deal a lot with creative businesses so it’s kind of the exact right job for me really.

And when I’m not doing that I run a thing called poddle which is a podcast and entertainment network that I created for me and my friends so that we can make stuff and share it and have fun doing it and start to build a community. I have been a fan of that medium podcasting and those various arts and pursuits since I left university in 2004 and I made my first pod cast in 2008 and I haven’t shut my mouth since. I’m a fan.

So, previously on Djangocon, I was at Djangocon Europe 2 years ago in Poland and gave a 5 minute lightning talk so this is my second of any talks like this so if I ramble, if it goes off the rails, you have my apologies. But stick with me.

So, 2 years ago I talked about contributing to a community via open source and I was also about 3 and a half stone heavier at the time so that was – over a good thing, nothing dreadful happened – and since then I’ve been able to contribute to the community and be part of it so the kind of things Russell has been talking about I’ve been lucky enough to do, contributed open source code via the web-site hub and I’ve had that stuff come back, people have had improvements to make to my code and you start to build something really cool.

So, speaking of building something really cool because this talk was an open day I’m not going to go into big technical conceits here. But one of the things I wanted to do was – I make one of the shows I make is me doing other things and sort of talking while I’m doing other things, it used to be called thoroughly distracted, and I wanted to make that pod cast entirely on my phone so I wanted to be able to record it on my phone with a head set and up load it and have it available to people to listen to and I did it via drop box and I was able to build a solution thanks to Django in apart 5 hours on an evening, got home from work thought this is what I want to do and I was able to build a working solution where I could up load a piece of audio from a drop box folder and my thing would read the meta base using – some of the batteries included in Python using some of the extensions in the Python package or the {inaudible} I was able to read the meta data, get the audio, images and text and put it into the {inaudible} for the podcast. And one of the reasons I was doing that is because I’m using this amazing language, a language that not only has a lot of stuff in it that comes free but it also means because it is such a popular language there are APIs available for pretty much anything that you want to work with whether that’s twitter and Facebook which I’ll get on to in a bit or it’s drop box or it’s some Apple web service or something else, there are Python packages available to let you work with those things because you are using a popular language that makes a big thing of having an extensive library.

When you start getting into Django itself if you not familiar with Django you’ll soon become familiar with the admin. It’s a content management system that comes included in your project so when you start writing your model which is how you want to store your data, you start to get with only a little bit of work you start to get a full content management back end if you like that you can start to up load your content with and there are ways to customise that. That is huge if you want to be able to build something that is based on creativity because it means you are not having to build a content management system to do all of that stuff, you get it for free, that’s one of the big bonuses you get over something like ruby on rails if you are making a choice for a web framework.

Django is really good at handling media not just on its own it does it really well but also there are some amazing libraries that handle that so we deal a lot with images and when you are dealing with images whether running a store or something else you might want to – for example with poddle we have big feature images for articles and with a library like sore thumbnail as an example that lets you deal so simply with images that you can say here’s my main image I want it in lots of different sizes, I don’t have to know what those sighs are beforehand I can tinker and try things in my image tags and see how it looks and make different response image size whatever it needs and you’ve got the tools to do that in an incredibly simple way with very little code no functional code, it’s all in Django template tags and it’s really simple so if you are dealing with images that is one of the great ways that you can get up and running really quickly so you can focus on making stuff rather than writing programmes.

So also you’ve got file browser which is a fantastic thing that plugs into your admin so if you want to re-use the same images or content, audio, video whatever, if you want to put part of it on a store or link to it on a blog post you don’t have to up load same content multiple times so with Django file browser which is an extension on top of an extension but very easy to use this gives you not only a way to select a file from a server be that your own server or be it Amazon cloud storage it also gives you the ability to embed those images in a text box, you can embed those easily select the file, it also gives you for images gives you more sizes so you’ve still got flexibility there and it’s a great way of being able to manage the content within your project.

So, one of the things that I mentioned about twitter and Facebook is trying to build a community so when you’ve built something cool and something that you want people to look at maybe you want to say, well, it’s a small web app and I want people to be able to log in and check it out and share and that kind of thing and one of the little batteries you can plug into your project is Django social. It’s a lovely, very simple way of being able to authenticate your users you are not worrying about building authentication system. Django has a solid system to use but if you don’t want your user to create user name and password because sometimes people are funny about that or don’t want to fill in from they simply want to get in authenticate from twitter or Facebook and say I’m happy for this site to use my profile and come back to your site then that is a fantastic tool to be able to do that and these are things you can use with writing very little code because the point is what I was able to do with my drop box example is I was able to connect lots of pieces together so I wasn’t really creating anything new, I was simply stitching things together so it made my ability to make stuff a lot easier and a lot simpler.

What’s wonderful about Django itself is it doesn’t prescribe that you have to build things in certain ways. It gives you a bit of flexibility to say if you want to write your views which is the functional views that maps URL to something that you can see effectively, if you want to write that in an object oriented way you are familiar with or write it more functionally you’ve got options to do that, you’ve got options to write things in lots of different ways and structure your project in lots of different ways. There are project templates that exist that are created in Django that allow people to have that flexibility so you absolutely get to build it your way by – it’s configuration over I don’t know what the … any way – thank you, configuration over convention. You get to host it your way and there are lots of ways you can host it, I used to use Apache and my SQL and there are people in here sucking their teeth going … but there are lots of different ways you can do it and Django lets you do that and I then started to use a host called digital ocean which gave me a bit more speed and I thought OK I’m going to learn how to do this properly using services like engine X, which is another web server, but the idea is because Django is abstracted from that, you can choose the layers that connect these different pieces together so you are not having to think OK it must be on – it has to be on Linux and Apache and started building my site on windows because I was a windows guy before I started and someone encouraged me to use Django. Window was what I used. So because Python as Russell says is cross platform it doesn’t care what operating system it’s on I was able to build my first Django web-site and get them running on a server so you’ve got huge level of flexibility whether you use Amazon web services to host your site or small host digital ocean, you want to put it on a shared box with lots of other web-sites you’ve got huge flexibility to do that.

And then once you’ve got your site hosted you can scale it up. Django is by default really scalable. It knows how to handle a lot of things but there are also lots of great system that’s plug into Django to help with things like cashing so when you view a web page and lots of people are viewing the same web-site the same home page if you like, Django isn’t having to constantly go back to the database figure out how to display it, put it into the template, it goes I have just done this I’ll get it direct from memory and show it to the user and that can make your web-site incredibly fast. You have huge levels of flexibility in terms of how you can configure that caching.

It’s not just about caching, it’s about other things in terms of scalability but caching is one of those things people will talk about.

And you’ve got fantastic support community in Django. There are people who are incredibly helpful. You’ll meet people here who’ll give you all sorts of advice; people tend to be very open. You’ve got places like stack overflow and the Django users Google group is useful. Also the IRC channel and there is a small plug, set up a slack community, called Django launch, it’s very, very small at the moment but it does mean – I use slack every day so it’s a room I can sit in and if people have questions then we’re able to hopefully answer those and at least commiserate and go yet I’ve had the same problem don’t know how to fix it – but at least you’ve got someone to talk.

So that’s it really. Let’s see how we did. Not too bad at all I’m quite happy with that. I’ve got a lot of details here where you can find the various things. All the stuff I’ve been talking about the pod casting stuff is on a web-site called poddle and there is a load of code stuff you can see of mine as well and you’ll find me bumbling around the conference.

So I want to say thank you to Django guys Djangocon organisers for letting me speak. I am visually impaired so this kind of thing is a bit daunting but I couldn’t be with a better community and I couldn’t be using a better platform, Django is my favourite platform to use. In my day job I use PHP, Word Press, I use a few other things, mainly those things but Django is always a thing if I want to build something that I care about in terms of or something that’s a hobby, I go straight back to Django and I always will because you get stuff up quickly and you can focus on the stuff you want to do rather than the nuts and bolts of the problem. If you are new to it, get involved, it is so much fun, so thank you very much and I thought I would leave a bit of time if anyone had any questions other than that thank you.

Transcribed at DjangoCon EU

DjangoCon EU 31st May 2015
Cardiff University, Cardiff, United Kingdom