DjangoCon Europe 2018 - Lightning Talks II
Keith-Magee, Russell
Laat, Arne de
Henschel, Lacey Williams
Verhaegen, Leila
Peña, Lorenzo
Hepper, Daniel
et al.
N. N.: Recording Lectures: With Python and GStreamer Laat, Arne de: HiSPARC: High School Project Astrophysics Research and Cosmics Henschel, Lacey Williams: How to Propose a Conference Talk? Verhaegen, Leila: Making a clock in Python Peña, Lorenzo: MTPU - Quick recipe for creating a simple software as a service with user hierarchies that gracefully downcast based on the current tenant Hepper, Daniel: The hidden powers of Custom Django Path Converters
 As a last point today, we have lightning talks again, and I think we were all looking forward to that. So I'll just hand it off to Russ again. All right. It's time for lightning talks again. So we all remember from yesterday what the deal is. Five minutes, no more, but can be less if you want to. And we do like people who do less because it means you get more talks through. There is a gong over here that will be attended to by my lovely assistant who will make sure that whoever is over here gets the message whenever their time is up. There is a timer down here we're keeping time to, and while we sit here and wait for people to get their AV set up, I get to regale you with delightful stories about the individual yesterday who went and was dealing with the wasps after meeting the head of the WOSP con as an expert WOSP observer, got involved with the organization of WOSP con and catering is a very big important part of any conference as we all know, but stories of this will progress. First up on stage we have Peter Kearnar talking about recording lectures with Python and G-Streamer. Everyone please welcome. Thank you very much. Hi Peter, I would like to give you a small introduction to the Huston hardware we're using here in this venue and a lot of other conferences to record live streams of lectures and doing live streaming and recording. I can switch my slides. I'm from C3 Rock. We are the video operation center of the CCC. You can find tons of information about video recording and streaming and production and distribution in our wiki and it's really not all that cleaned up, but it contains tons of information you can find me personally under this nickname on Twitter. This is part of our pipeline. It's only half of it. The upper half is concerned with capturing video signals from speaker notebooks and audio and video signals from the cameras around the lecture room. All those signals are then fed into a Vokto mix. That's these parts and it's a Python and G-Streamer based mixer solution. You can see from the schematic that it's basically split into two halves. One is Vokto Core. It's like a headless server and the other one is Vokto GUI. This is the streaming diagram, block diagram of Vokto Core. It basically acts as a network server accepting and providing video feeds on TCP ports. The mixing pipeline we implemented is very specific for lecture recording. You can transmit a nice pause animation and some elevator music during a break while continuing to recording the actual content. If you accidentally miss hitting the go live button, you still have a useful recording. The mixing pipeline also can handle multiple audio feeds for live translations, for example, and it probably can be extended to other nifty, crazy stuff. From the code perspective, it basically looks like this. We are plugging together G-Streamer pipelines in Python as strings and then giving them to G-Streamer to parse them. G-Streamer then implements, builds a multimedia pipeline from it. It's like Lego for audio and video. You stick together the pieces you need. The UI looks like this. It connects to Vokto Core via TCP network and when you press a button, it sends commands over there over a simple line-based protocol. So writing new GUIs or other interfaces is quite easy. You can literally mix video with Netcat and Telnet. It's really trivial to automate. Just one example is these little guys. We have them here on our cameras. They are Raspberry Pis that connect to the Vokto Core and receive the line-based protocol and turn the light on the LED on whenever the camera is live. You can find all the code and a lot of the documentation in GitHub. And if you want to talk to us and have questions, please visit us. We are upstairs there. If you go upstairs, please be a little bit quiet. Oh, they're ringing. Ring again. Whee! If you go upstairs, please be quiet. But you can always talk to us and we're really open and welcome to explain to you what we're doing. And because we have a really nice setup here, I have some pictures. This is the main camera that's right there in the middle of you. We have a second camera above there. And we also have, like, this is a really nice view from our mixing console upstairs. So thank you very much. And if you have any questions, please approach us and we will explain you how to set up your own video recording for your own conferences. Thank you very much. Thank you very much, Peter, while we get our next speaker set up. So this guy gets the job to organize the conference catering. So he goes out to essentially a conference conference to go and forget where all the vendors turn up and show their wares and talk about what they can do and what they can provide for your conference. And this place has got tents set up and every vendor has their own tent where they can demonstrate how they can serve food and how much food they can serve and what have you. And so he turns up and he sort of walks into the first tent. And the first tent is selling essentially German themed food. There's like a selection of a verset and sauerkraut and homemade mustards. And there's some decent queues, people lining up to get in there. And then there's some really, really long queues because they're also serving beer in the tent and the longest queue is to get to the beer. So this guy just stands there and he tries the food. Yeah, this is all very good food, but the queues are a bit of a problem, particularly the long lines for the drinks. People are willing to wait for food for a little bit, but you really don't want to get them waiting too long for a drink. So okay, maybe I'll try again. I'll try and try another location, another one of the tents and see where that's going to be better suited to our needs. So he goes on to the next tent. The next tent is an American barbecue themed tent. They've got all sorts of different barbecues, Southern barbecue, Texas barbecue, Kansas barbecue. They don't ever get into a barbecue discussion with an American. They get very, very techy about barbecue. And there's all this barbecue and there's fresh coleslaw. There's some decent queues. Again, people lining up and getting their food, getting their barbecue. But then there's some freshly squeezed lemonade as the drink that they're offering there. And again, really long queues for this fresh squeezed lemonade because it's really good, but also it just takes a while to produce to get a good glass of lemonade. So there's these long queues and the guy's in there and he tries it out and it's the food's really good. Barbecue's really good, good selection of barbecue and the coleslaw that goes with it's really good as well. And still going. All right. And again, the lemonade is refreshing and it's tasty. But again, really long lines to get yourself a drink. So okay, it's probably not going to be the one for us. Are we... Nope. All right. So he tries the next tent. I'm moving through far too many of my tents here. I'm going to have to convince some new tents. He gets through the next tent. The next tent is a different type of barbecue. This is Brazilian barbecue. So Brazilian barbecue, if you don't know, is basically all about meat. Brazilians really do like their meat. So he goes in and he says, okay, yes, here we go. Some beautiful meat on the great big skewers. Have you ever been to a church here? It's a fantastic way of having Brazilian barbecue. And the vendors there are slicing big pieces of meat off of the skewers and serving to each of the individual patrons as they turn up. Being Brazilian though, there is no salad that goes with it. It's just the meat. And they've also got... No, I'm still waiting for... Yeah, okay, we're still going. He's going through the... They've got a caparinha station there. The Brazilians, they do make a very good caparinha made out of really good imported cassaca. Delicious. But again, reasonable queues for the food. They can get the food out going out relatively quickly. But the drink station, it takes a while to mix a good caparinha. So there's really, really long lines for the caparinhas. And so he moves on to the next tent. Next tent is an Italian themed tent. Have we got an ETA at all? I'm with... Yeah, so it's an Italian themed tent. And it goes in there and as you predict, the pastas and meals like that with some nice salads on the side as well. This was not the agreed pattern. This is going to turn into a five minute joke in between all the others. All right, so we're getting another laptop line up. So it's the Italian themed booth. We have the Italian themed meal. We've got the pastas and the pastas are all there and some salads. And of course, it's Italian, so we've got some good red wine there and they've got the red wine coming out. But again, decent queues for the food. People are moving the food through relatively quickly. But then the lines for the drinks, for this red wine, really, really long lines as everybody gets their drinks. This is a possibility. I might get a breather here. We're getting close. We're waiting for flashes. Okay. So, okay, the guy organising this conference is starting to get a little bit concerned. It seems to be a recurring theme here. We sort of go into all these booths. Really, really good creative food vendors producing really, really tasty food. But there's long lines at every drink station that they turn up to. And they have full screen. And they have full screen. And they have full screen. That's the line up there. Yeah, there we go. All right. But you can tell that he's going to have to keep looking. I'm going to have to keep looking as well to see if he can find the vendor that's going to be right for him. And are we going to download the whole, okay. And then it will work. There we go. All right. So the search will continue after the break. Next we run up here on stage now. We have Arne Delat with cosmic ray research with data analysis via Django and some astroparticle physics. Take it away, Arne. Good afternoon. I now work at local doing web development. My previous job was doing astroparticle physics at NICF in Amsterdam. There I analyzed stuff with supernova. So this is an image of a supernova explosion where a star explodes. The shell of particles being ejected by the supernova accelerates particles which are just out there in space. It picks them up and accelerates them. And using big magnets it keeps them until they're fast enough and then it checks them all throughout space. Some of those particles moving at almost the speed of light hit the earth. Then this happens. There's a particle at the top and it hits another particle in our atmosphere. And there's so much energy that they create more particles and those particles have enough energy to collide again and create more particles until you have on the ground maybe between one and several billion particles. Those are just electrons, muons which are the slightly heavier version of electrons. And there's, you know, at high spark we detect those particles. So in the top right you see a scintillator which glows a bit if those particles go through it. We wrap those in light-tight plastic and then we put them in those key boxes. And there are photo multipliers connected which see the scintillator glow and they convert that to a strong electrical signal. Then you have the little box on the lower left and it converts electrical signals into bits and bytes and it continuously reads out the signal every two and a half nanoseconds. So you get this really sharp signal. And then we put several of those detectors very close together so you can see if multiple of them are hit then you are dealing with one of those air showers. If only one sees something then it's probably some background radiation. Not interesting. So this is how the network looks like. You have huge things in space which shoot out these cosmic rays. These cosmic rays interact in our atmosphere and we have several detector stations and they detect these events. All the data is sent to the NICF in Amsterdam where we do a bunch of data analysis and there's this nice Django application which does all the bookkeeping and manages all this. So there are about 100 of these detection stations. Most of them are at high schools. So it's an outreach project. High school students build these detectors. They put them on the roof of their schools and they can then work with the data from their station, from all the other stations and do nice experiments, see what they can learn about relativity, quantum physics and other interesting stuff. This is an example of an event at the Science Park in Amsterdam where there are several stations very close together. The color indicates the arrival time so more blue is earlier, redder is later. So you have this one particle coming from outer space. It creates all these new particles and they all go at the speed of light. So basically if you take a snapshot it's all these particles in a flat plane so they also hit the ground in that plane. So first they hit on the right and then a bit later there and there and there and there. So using that timing difference you can get a sense of the direction of this air shower and using the number of particles which is indicated by the size of the blobs. You can guess where the center of the core was and then you know something about the energy of the air shower, you know something about the energy of the cosmic ray and you might guess where it came from with the direction. It's all very interesting. So we have a lot of teaching material and tools for these high school students to work with this data. A lot of documentation, all the code is open source so the code running on the detection stations, the Django that's managing all the data coming in. This project has been running since 2004. There's about six billion events that have been detected which is about six terabytes of data which is then reduced, reconstructed and all the data is made available via nice APIs and we provide a nice JavaScript tools to do stuff with it and Python framework to also do analysis with it. It's all very nice. And yeah, this used to be a movie but now it's a PDF because it was on my laptop and maybe I can show it quickly. Oh, where's the slash there? All right. Thank you very much, Arnie. So whilst our next speaker gets set up, the search continues for the perfect conference food. So having been to the German tent and the Italian tent and the Brazilian tent and the US barbecue tent, the guy walks on to the next tent. The next tent is a Mexican tent. They've got a little taco truck set up in there. Behind the counter, furiously making tacos for everybody and they're beautiful. Fish tacos and chicken tacos and beef tacos and they're all fantastic. And then I've got a little margarita stand on the side. So they're making margaritas for everybody to drink while they're at it. And are we good to go? So again, we've got long lines for the margaritas but the rest of the food goes through well. But the long lines are a problem. We need to look somewhere else. Next speaker is Lacey Williams-Henshaw talking about how to propose a talk. We want to welcome. I have to figure out where to stand because I'm really short. But I don't have a clicker either. So yeah, I want to talk to you about how to propose a conference talk because I work on conferences and I speak at conferences and so I've done this a few times. I need to stay over here though so the mic catches me. So the first thing that you need to do a conference talk, oh, there's the timer over there, that's nice, is an idea, right? And so where do you get ideas? So you can think about what have you learned recently? My personal opinion is that the most qualified person to speak on a given topic is the person who was most recently completely perplexed by that topic because you know what you had to do to get over that hump to figure out how to understand that. Sometimes you have really strong opinions about something. You think that testing should be done a very particular way or you think that code should be organized in this very, very specific way. You can share those very strong opinions with a group. Sometimes something that really confuses you now makes sense to you. So again, this is related to one but it's also its own separate thing. So there's learning a new thing but then there's taking a thing that you kind of understood before and then finally you really, really, really understand it. For example, Katie's talk about the ORM. Then you need to think about your talk a little bit. So you want to think about how broad is your topic? So like I said, for example, testing, you really can't just give a talk about testing in about half an hour, right? Like a general topic, a general conference talk is about 25 to 30 minutes. So think about can I sum up this topic in two minutes to someone who doesn't know very much about it? Like hit my high points, get my arc and then you know, okay, I've got a decent idea. Once you have an idea and you're thinking I am ready, I want to propose this talk, you want to find the CFP. CFP stands for call for proposals and the first thing that you want to do is read that CFP carefully. Not all CFPs are created equal. They all have their own special requirements. They also all have deadlines and it is very unfortunate as an organizer whenever someone emails you and they said, oh, I'm so sorry, I just missed the deadline. I had it wrong in my calendar. You don't want that to be you. So you want a very close attention to the deadline and also attention to the time zone that the deadline is in. Finally, you want to make sure that you know what the anonymity requirements are, right? So a lot of CFPs require an anonymous submission. So you might be tempted in your talk to talk about your credentials and there is certainly place for you to do that but you want to make sure that if this is an anonymous review process that you're not putting identifiable information in the body of your proposal. Finally, or not finally, the next step is you actually have to write the CFP, right? You have to write your proposal, get it ready to submit. In general, you're going to want a short abstract which is printed in the program or put on the website that's about 300 characters. Then you'll want a longer description that gives the organizers a chance to see that you're prepared to talk on this topic that you know what you're doing. Sometimes you want an outline, some conferences even want you to have an outline that includes the time. So you're going to spend one minute on the introduction and you're going to spend three minutes talking about this. Those are kind of annoying but you have to do it anyway. So make sure again, read the CFP closely and make sure that you're following their prescription. Then you want to write your bio. This is the thing that really trips people up. It is really hard to write about yourself like it sucks a lot. So there are some tools online that can help you. I will tweet those later on and you'll notice that my Twitter and a couple of other Twitter accounts are at the bottom there. So yeah, you'll want to prepare some kind of statement about yourself that again gets put on the website, maybe printed in the program to let people know who you are. Then you'll want to edit your CFP. So this is before you submit. Don't just type it all into the window and then hit submit. You want to run this by somebody. So you can run this by your friends. You can run this by colleagues at the place where you work or people that you've worked with before. A lot of times conferences will have speaker mentors so you can go to the website or email the conference and see if that's something that you can take advantage of. You can reach out on Twitter and say hey, I want to submit a talk on this topic, will someone review this? And people will say yes. They will just say hey, send me the link and they will give you feedback. Also slacks that you're in are a really great opportunity. Then you actually hit submit. And this is a really, really proud moment, right? But you might have some concerns about speaking at conferences. So for example, you might wonder if you know enough to present on a topic. And the answer is yes that you do. You also might be worried about how much it costs. A lot of conferences have financial aid. You might be concerned about your work and whether they'll support you. You should just ask. My experience is that a lot of bosses, if you're speaking, will say yes. And you might wonder if you'll get rejected. So if you have spoken at a conference, ever raise your hand. If you have never been rejected from a conference, keep your hand up. Or like I guess, oh, I'm sorry. I did that wrong because I'm running out of time. But basically there are two CFPs that are open right now. I have two seconds left. Take a picture of this slide. And Jenga Khan AU and Jenga Khan. Thank you very much, Lacey. Okay. So we've, Mexican didn't work out. So our next big, next vendor that he tries out is the Spanish, Spanish vendor. And inside the Spanish tent, they've got a little tapas bar set up. So you pick up your own little pieces of tapas from the selections that are there. And there's a really wide selection of tapas. Quite impressive. Not too bad cues going on with what's there. And the drinks, they're serving sangria, which is lovely. But again, really long cues on the sangria. So this is going to be a problem. It seems to be a recurring theme. It's like the food doesn't seem to be an issue. People can get the food out relatively quickly. But the drinks lines are becoming a bit of a concern. Are we good to go? Yes. All right. So our next speaker is, I made a clock in Python. Layla Vohegen. Take it away. Hello. Well, hello. My name is Layla. And I will talk to you about making a clock in Python. So a few months ago, my clock was broken, just like this one. And I wanted a new one with a few basic requirements. It had to be blue and the time had to be visible when it was dark. After searching a lot and only finding red and green ones, I decided to make it myself. To make this clock, I used an M0 train cut, a Tc module and a blue squad, seven segment display and each driver. I also used a breadboard and a lot of wires. As you can see, I used a medium and a small breadboard. On the top, it's a circuit without component. And on the bottom, the thing in the middle, it's a 3.3 volt to 5 volt one way logic converter. Because the data sheet said the RTC and display drivers needed 5 volts and the train cut outputs 3.3 volts. But I should have a two way logic converter to this to work and I didn't have one. In the end, it turns out both the RTC and the display driver work fine with 3.3 volt signal. So I got rid of the logic converter altogether. At this point, I also decided to use a single medium breadboard so I had to make a new circuit. Both RTC and display drivers come with their own Python module but both modules don't fit in memory at once. So I had to write my own time management library to under the RTC module to unsave some memory. As you can see on this photo, the clock finally works after four days of making circuits and two hours of writing code. It was very, very satisfying to see it work. Well, after my success with the small clock, I know I want a bigger one. A slightly different one. I decided to make one with pizza boxes and new pixels. If you don't know, new pixels are bright RGB led. Right now, this project is still working in progress because I have time to finish yet but I think I will work on it after this. If I talk to you about this clock today, it's because I know that sometimes we want to give up but I also know that if we preserve, we can climb mountains and even more. Thank you. Thank you very much. Okay. Here we go. There we go. We have another speaker. So the search continues. We have tried Mexican. We have tried the Spanish. We have tried the American barbecue. We have tried the Brazilian barbecue. We have tried the German. We have all got the same basic problem going on here. So next, okay, we are going to the Indian tent. The Indian is a subcontinent India. There are lots of curries. Large sort of bain-marie trays filled with all sorts of aromatic curries. Add a lot of these vegetarian. They are all still really great food. One big bowl of rice to serve that as well. Relatively fast moving cues, getting to all of the curries that are there. But then there is the drink station. They are making mango lassies, yogurt drinks. And again, really long cues on the mango lassie for some reason. So this probably isn't going to be the one we have got a problem with the long cues again. So the search continues. Our next speaker is Lorenzo Peña talking about multi-tenant polymorphic users. Okay. Hi, everyone. My name is Lorenzo Peña. I am Lorenzo's Twitter, GitHub, Facebook, Gmail and pretty much everywhere. I come from Holguin, Cuba. And it's a great privilege to be here today. Big thanks to the YangoCon crew. This is my first YangoCon ever. My first time in Europe. My second time in South of Cuba. My first time publicly speaking in English. And my ninth year in the exciting world of Yango. I somehow expect that nine to compensate for all the former ones and twos. The code name for this lightning talk is MTPU, which stands for multi-tenant polymorphic users, which in turn is a fanciest name I could find to summarize the otherwise longer quick recipe for creating a simple software as a service with user hierarchies that gratefully downcast based on the current tenant. So big disclaimer. This is just a recipe. I didn't create any of the ingredients myself. This is only intended as a phone experiment. This is no civil bullet for anything. Consult your doctor before attempting this on production environment. Ready? Okay. Here we go. We're going to have a project at www.shinydomain.com and we want to build a shiny software as a service using a single Yango project. At www.shinydomain.com, we're going to have the corporate site where our customers will acquire private space at whatever name they choose, shinydomain.com. So far, so good. Now come the users. For most practical cases, we might not want to store the same information for our possible user types in a project like this. Think of it at the www site. We're going to have our corporate users who should be dealing with tenant management and cool enterprise operations and hopefully, payment processing. And at www.shinydomain.com, we're going to have the user structure that makes sense at the application level we're offering as a service and isolated users. It could be a single user type or it could actually be a hierarchy of user types. Yango Contrib Alph comes with the fall user model in order to store all relevant information depending on the user type. We could fall back to using profile models with one-to-one relationship to the user as it's still suggested somewhere in the Yango docs. However, that would take all the fun out of this experiment. Besides, there's another implicit way of creating one-to-one fields. So we're going to use a custom user model. Actually a custom concrete base user model that other user models will inherit to create a hierarchy. So cooking time. Here are our selected ingredients for the MTPU recipe. For solving the multi-tenancy problem in a single Yango project, we're going to use Yango tenants. It relies on Postgres schemas to isolate tenant tables within a single database. Again, as other packages, the Rallium Postgres schemas, it creates a new schema for every new tenant while keeping all shared tables in default public schema. For more ingredients like this, can be found at the Fresh Market, aka yangopackages.com under the multi-tenancy grid. And for handling not too complex model hierarchies, we're going to use the Yango Polymorphic. With this package, if we define models that use concrete inheritance, we can query the parent models and get the downcasted instances. So if we have places, restaurants, and bistros, where place is the base class for restaurants and bistros, we can query places and get not just places instances as vanilla Yango returns, but the actual type of existing instances. This comes at the cost of some extra join, some drag in performance, and a little bit of dark magic. But shouldn't be a great problem if the hierarchy is not super complicated model tree. Again, more ingredients like this can be found in the model inheritance grid of yangopackages.com. So how these ingredients work together. First, forgetting polymorphic users, we just need to define a custom user model and inherit polymorphic model. We might want to inherit also abstract base user to incorporate common user functionality. Just make sure polymorphic model is the first one in place so that polymorphic behavior actually works. We must also define a manager that inherits polymorphic manager and uses default manager for the base user model. For Yango tenants to work properly, there are some preliminary steps we need to take like creating the tenant and domain models. However, we're going to spare the details here for the sake of time. The only thing we're going to cover here is tenant and shared application. Yango tenants has the concept of shared apps and tenant apps. With this, the regular setting for install apps becomes just an order union of the former. Models in shared apps will live in the default schema while models in tenant apps will live in every other schema that is created for the tenant. If the same app is provided both in shared and tenant apps, its models will live in all schemas. But notice in the context of any tenant, tables in tenant schemas will take presence over those in the public schema. There is more to talk about this. We can skip the correct details for now. So all we just have to do is know where to place everything and since we don't have time anymore and this we could be inside the cage, I'm just going to leave here proof of concept if you want to see it in action. Thank you very much. Thank you very much. Thank you very much. In fact, we have our one last lightning speaker to talk to today while they get set up. Our intrepid wasp expert is trying to get a little bit desperate. He is really trying to look for the perfect cuisine that is going to work and be able to be served quickly to a large wasp enthusiast audience. And he finally comes across the Australian tent. The Australian tent is sort of this weird Asian fusion thing. This is like kangaroo carpaccio and there is emu satay and all sorts of weird combinations of Australian food or Australian native animals that are done in a sort of vaguely Asian sort of style which is unusual. There are still people here so obviously it can't be bad. He lines up and he gets in the queue and says this food is really, really good. It's been expertly prepared and it comes out quickly. And then he goes over and looks for the drink situation. And they are serving a fruit punch. There is a native Australian fruit punch. Which sounds good but there is no line. There is no line at all. This is weird. I have to work out what is going on here. Our next speaker is Daniel Hepburn talking about the hidden powers of custom Django path inverters. Hi, I am Daniel and I want to show you a somewhat obscure feature that is new in Django 2.0. So who read the release notes? What is new in Django 2.0? Yay, no more regular expressions in URLs. We have a simplified URL routing syntax. Instead of using URL with a regular expression in it, use the path method to capture an URL argument, use angle brackets. After the column, that is the name of the argument and before the column, that is a so-called path converter which you can define. So path converter converts. So in this case, it converts the argument into an integer. So your view will actually get an integer and not a string as it used to be. So there are a couple of built-in path converters. Under the hood, they still use a regular expression. So string integers, lock path and also UUID. But now you might say, wait a minute, that is not really a feature equivalent, regular expression that accepts exactly four digits and an integer can be like any number of digits, basically. So that is where custom path converters come into play. It is a plain class that has, again, a regular expression. So if you hate regular expression, kind of bad news. And it has a two-python method which handles the converting from the URL to the Python object. And it has a two-URL method which handles the reversal. So now for our four-digit URL pattern, that is the custom path converter. To use it, you have to register it and give it a name. And the name is what you then use in URL. So far so good. That's all in the documentation. But this line called myI, it says it should raise a value error if it can't convert a given value. But it doesn't say is what happens when that value error gets raised. You might expect that you get a server error or something like that. But actually, the conversion is part of the matching. So if a value error gets raised, the path just doesn't match. So how can we use it? Let's say we have a URL which gets an ID. And then you have a view which gets an object or returns a 404. And you also have a URL tag in a template that does the reversal. Now you can write a custom converter class which fetches the object in the two-python method and raises a value error if the object doesn't exist. And the URL method just takes a return to the ID of the object. You register that converter and give it a name. In this case, I was not very creative. So it's a question converter. And now your view receives a question object. And you can also just pass a question object to your URL reversal. Now you don't want to write a converter for each model, obviously. So you can generalize that, and I wrote a register model converter method which dynamically builds a model converter class which you can use like this. And by default, it just uses the name of the model as the name of the converter. Then I came up with a couple of other useful features like passing an optional name and using a different field for lookup and using a different base class. For example, your primary key is a UID, you can also pass a query set. That's where the advertising part starts. I packaged that in a Python package which you can just install with pip install Django model path converter. And then you just do register model converter with your model class. And then you have models in your view. Here are the links to the pipi and GitHub and also my Twitter and my email if you want to tell me why that's a bad idea. Thank you. Thank you very much. That concludes the lightning talks for today. Thank you very much to all the lightning talk speakers. Thank you very much to our delightful Gonging person who didn't have a great deal of need to Gong because everybody was under time. It's wonderful. One last issue we have to work out is why was the Australian queue able to get through the drinks so quickly? So the guy who is organizing the wasp con goes to find the manager of the Australian tents. So what's the story here? What's going on? Everyone else. I've been to all these other tents. I've been to Mexican tents. I've been to American tents. I've been to Brazilian tents. They've all got good rates of throughput for the food but they've got huge, huge lines for the drinks. And I come in here and you're serving this delicious punch which is fantastic. But there's no queue. So what's the story? And so the Australian manager turns to the guy and looks him straight in the eye and says, why would there be a punch line?
 As a last point today, we have lightning talks again, and I think we were all looking forward  to that.  So I'll just hand it off to Russ again.  All right.  It's time for lightning talks again.  So we all remember from yesterday what the deal is.  Five minutes, no more, but can be less if you want to.  And we do like people who do less because it means you get more talks through.  There is a gong over here that will be attended to by my lovely assistant who will make sure  that whoever is over here gets the message whenever their time is up.  There is a timer down here we're keeping time to, and while we sit here and wait for people  to get their AV set up, I get to regale you with delightful stories about the individual  yesterday who went and was dealing with the wasps after meeting the head of the WOSP con  as an expert WOSP observer, got involved with the organization of WOSP con and catering  is a very big important part of any conference as we all know, but stories of this will progress.  First up on stage we have Peter Kearnar talking about recording lectures with Python and G-Streamer.  Everyone please welcome.  Thank you very much.  Hi Peter, I would like to give you a small introduction to the Huston hardware we're  using here in this venue and a lot of other conferences to record live streams of lectures  and doing live streaming and recording.  I can switch my slides.  I'm from C3 Rock.  We are the video operation center of the CCC.  You can find tons of information about video recording and streaming and production and  distribution in our wiki and it's really not all that cleaned up, but it contains tons  of information you can find me personally under this nickname on Twitter.  This is part of our pipeline.  It's only half of it.  The upper half is concerned with capturing video signals from speaker notebooks and audio  and video signals from the cameras around the lecture room.  All those signals are then fed into a Vokto mix.  That's these parts and it's a Python and G-Streamer based mixer solution.  You can see from the schematic that it's basically split into two halves.  One is Vokto Core.  It's like a headless server and the other one is Vokto GUI.  This is the streaming diagram, block diagram of Vokto Core.  It basically acts as a network server accepting and providing video feeds on TCP ports.  The mixing pipeline we implemented is very specific for lecture recording.  You can transmit a nice pause animation and some elevator music during a break while continuing  to recording the actual content.  If you accidentally miss hitting the go live button, you still have a useful recording.  The mixing pipeline also can handle multiple audio feeds for live translations, for example,  and it probably can be extended to other nifty, crazy stuff.  From the code perspective, it basically looks like this.  We are plugging together G-Streamer pipelines in Python as strings and then giving them  to G-Streamer to parse them.  G-Streamer then implements, builds a multimedia pipeline from it.  It's like Lego for audio and video.  You stick together the pieces you need.  The UI looks like this.  It connects to Vokto Core via TCP network and when you press a button, it sends commands  over there over a simple line-based protocol.  So writing new GUIs or other interfaces is quite easy.  You can literally mix video with Netcat and Telnet.  It's really trivial to automate.  Just one example is these little guys.  We have them here on our cameras.  They are Raspberry Pis that connect to the Vokto Core and receive the line-based protocol  and turn the light on the LED on whenever the camera is live.  You can find all the code and a lot of the documentation in GitHub.  And if you want to talk to us and have questions, please visit us.  We are upstairs there.  If you go upstairs, please be a little bit quiet.  Oh, they're ringing.  Ring again.  Whee!  If you go upstairs, please be quiet.  But you can always talk to us and we're really open and welcome to explain to you what we're  doing.  And because we have a really nice setup here, I have some pictures.  This is the main camera that's right there in the middle of you.  We have a second camera above there.  And we also have, like, this is a really nice view from our mixing console upstairs.  So thank you very much.  And if you have any questions, please approach us and we will explain you how to set up your  own video recording for your own conferences.  Thank you very much.  Thank you very much, Peter, while we get our next speaker set up.  So this guy gets the job to organize the conference catering.  So he goes out to essentially a conference conference to go and forget where all the vendors  turn up and show their wares and talk about what they can do and what they can provide  for your conference.  And this place has got tents set up and every vendor has their own tent where they can demonstrate  how they can serve food and how much food they can serve and what have you.  And so he turns up and he sort of walks into the first tent.  And the first tent is selling essentially German themed food.  There's like a selection of a verset and sauerkraut and homemade mustards.  And there's some decent queues, people lining up to get in there.  And then there's some really, really long queues because they're also serving beer in the tent  and the longest queue is to get to the beer.  So this guy just stands there and he tries the food.  Yeah, this is all very good food, but the queues are a bit of a problem, particularly  the long lines for the drinks.  People are willing to wait for food for a little bit, but you really don't want to  get them waiting too long for a drink.  So okay, maybe I'll try again.  I'll try and try another location, another one of the tents and see where that's going  to be better suited to our needs.  So he goes on to the next tent.  The next tent is an American barbecue themed tent.  They've got all sorts of different barbecues, Southern barbecue, Texas barbecue, Kansas  barbecue.  They don't ever get into a barbecue discussion with an American.  They get very, very techy about barbecue.  And there's all this barbecue and there's fresh coleslaw.  There's some decent queues.  Again, people lining up and getting their food, getting their barbecue.  But then there's some freshly squeezed lemonade as the drink that they're offering there.  And again, really long queues for this fresh squeezed lemonade because it's really good,  but also it just takes a while to produce to get a good glass of lemonade.  So there's these long queues and the guy's in there and he tries it out and it's the  food's really good.  Barbecue's really good, good selection of barbecue and the coleslaw that goes with it's  really good as well.  And still going.  All right.  And again, the lemonade is refreshing and it's tasty.  But again, really long lines to get yourself a drink.  So okay, it's probably not going to be the one for us.  Are we...  Nope.  All right.  So he tries the next tent.  I'm moving through far too many of my tents here.  I'm going to have to convince some new tents.  He gets through the next tent.  The next tent is a different type of barbecue.  This is Brazilian barbecue.  So Brazilian barbecue, if you don't know, is basically all about meat.  Brazilians really do like their meat.  So he goes in and he says, okay, yes, here we go.  Some beautiful meat on the great big skewers.  Have you ever been to a church here?  It's a fantastic way of having Brazilian barbecue.  And the vendors there are slicing big pieces of meat off of the skewers and serving to  each of the individual patrons as they turn up.  Being Brazilian though, there is no salad that goes with it.  It's just the meat.  And they've also got...  No, I'm still waiting for...  Yeah, okay, we're still going.  He's going through the...  They've got a caparinha station there.  The Brazilians, they do make a very good caparinha made out of really good imported cassaca.  Delicious.  But again, reasonable queues for the food.  They can get the food out going out relatively quickly.  But the drink station, it takes a while to mix a good caparinha.  So there's really, really long lines for the caparinhas.  And so he moves on to the next tent.  Next tent is an Italian themed tent.  Have we got an ETA at all?  I'm with... Yeah, so it's an Italian themed tent.  And it goes in there and as you predict, the pastas and meals like that with some nice  salads on the side as well.  This was not the agreed pattern.  This is going to turn into a five minute joke in between all the others.  All right, so we're getting another laptop line up.  So it's the Italian themed booth.  We have the Italian themed meal.  We've got the pastas and the pastas are all there and some salads.  And of course, it's Italian, so we've got some good red wine there and they've got the red  wine coming out.  But again, decent queues for the food.  People are moving the food through relatively quickly.  But then the lines for the drinks, for this red wine, really, really long lines as everybody  gets their drinks.  This is a possibility.  I might get a breather here.  We're getting close.  We're waiting for flashes.  Okay.  So, okay, the guy organising this conference is starting to get a little bit concerned.  It seems to be a recurring theme here.  We sort of go into all these booths.  Really, really good creative food vendors producing really, really tasty food.  But there's long lines at every drink station that they turn up to.  And they have full screen.  And they have full screen.  And they have full screen.  That's the line up there.  Yeah, there we go.  All right.  But you can tell that he's going to have to keep looking.  I'm going to have to keep looking as well to see if he can find the vendor that's going  to be right for him.  And are we going to download the whole, okay.  And then it will work.  There we go.  All right.  So the search will continue after the break.  Next we run up here on stage now.  We have Arne Delat with cosmic ray research with data analysis via Django and some astroparticle  physics.  Take it away, Arne.  Good afternoon.  I now work at local doing web development.  My previous job was doing astroparticle physics at NICF in Amsterdam.  There I analyzed stuff with supernova.  So this is an image of a supernova explosion where a star explodes.  The shell of particles being ejected by the supernova accelerates particles which are  just out there in space.  It picks them up and accelerates them.  And using big magnets it keeps them until they're fast enough and then it checks them  all throughout space.  Some of those particles moving at almost the speed of light hit the earth.  Then this happens.  There's a particle at the top and it hits another particle in our atmosphere.  And there's so much energy that they create more particles and those particles have enough  energy to collide again and create more particles until you have on the ground maybe between  one and several billion particles.  Those are just electrons, muons which are the slightly heavier version of electrons.  And there's, you know, at high spark we detect those particles.  So in the top right you see a scintillator which glows a bit if those particles go through  it.  We wrap those in light-tight plastic and then we put them in those key boxes.  And there are photo multipliers connected which see the scintillator glow and they convert  that to a strong electrical signal.  Then you have the little box on the lower left and it converts electrical signals into  bits and bytes and it continuously reads out the signal every two and a half nanoseconds.  So you get this really sharp signal.  And then we put several of those detectors very close together so you can see if multiple  of them are hit then you are dealing with one of those air showers.  If only one sees something then it's probably some background radiation.  Not interesting.  So this is how the network looks like.  You have huge things in space which shoot out these cosmic rays.  These cosmic rays interact in our atmosphere and we have several detector stations and  they detect these events.  All the data is sent to the NICF in Amsterdam where we do a bunch of data analysis and there's  this nice Django application which does all the bookkeeping and manages all this.  So there are about 100 of these detection stations.  Most of them are at high schools.  So it's an outreach project.  High school students build these detectors.  They put them on the roof of their schools and they can then work with the data from  their station, from all the other stations and do nice experiments, see what they can  learn about relativity, quantum physics and other interesting stuff.  This is an example of an event at the Science Park in Amsterdam where there are several  stations very close together.  The color indicates the arrival time so more blue is earlier, redder is later.  So you have this one particle coming from outer space.  It creates all these new particles and they all go at the speed of light.  So basically if you take a snapshot it's all these particles in a flat plane so they also  hit the ground in that plane.  So first they hit on the right and then a bit later there and there and there and there.  So using that timing difference you can get a sense of the direction of this air shower  and using the number of particles which is indicated by the size of the blobs.  You can guess where the center of the core was and then you know something about the  energy of the air shower, you know something about the energy of the cosmic ray and you  might guess where it came from with the direction.  It's all very interesting.  So we have a lot of teaching material and tools for these high school students to work  with this data.  A lot of documentation, all the code is open source so the code running on the detection  stations, the Django that's managing all the data coming in.  This project has been running since 2004.  There's about six billion events that have been detected which is about six terabytes  of data which is then reduced, reconstructed and all the data is made available via nice  APIs and we provide a nice JavaScript tools to do stuff with it and Python framework to  also do analysis with it.  It's all very nice.  And yeah, this used to be a movie but now it's a PDF because it was on my laptop and  maybe I can show it quickly.  Oh, where's the slash there?  All right.  Thank you very much, Arnie.  So whilst our next speaker gets set up, the search continues for the perfect conference  food.  So having been to the German tent and the Italian tent and the Brazilian tent and the  US barbecue tent, the guy walks on to the next tent.  The next tent is a Mexican tent.  They've got a little taco truck set up in there.  Behind the counter, furiously making tacos for everybody and they're beautiful.  Fish tacos and chicken tacos and beef tacos and they're all fantastic.  And then I've got a little margarita stand on the side.  So they're making margaritas for everybody to drink while they're at it.  And are we good to go?  So again, we've got long lines for the margaritas but the rest of the food goes through well.  But the long lines are a problem.  We need to look somewhere else.  Next speaker is Lacey Williams-Henshaw talking about how to propose a talk.  We want to welcome.  I have to figure out where to stand because I'm really short.  But I don't have a clicker either.  So yeah, I want to talk to you about how to propose a conference talk because I work on  conferences and I speak at conferences and so I've done this a few times.  I need to stay over here though so the mic catches me.  So the first thing that you need to do a conference talk, oh, there's the timer over  there, that's nice, is an idea, right?  And so where do you get ideas?  So you can think about what have you learned recently?  My personal opinion is that the most qualified person to speak on a given topic is the person  who was most recently completely perplexed by that topic because you know what you had  to do to get over that hump to figure out how to understand that.  Sometimes you have really strong opinions about something.  You think that testing should be done a very particular way or you think that code should  be organized in this very, very specific way.  You can share those very strong opinions with a group.  Sometimes something that really confuses you now makes sense to you.  So again, this is related to one but it's also its own separate thing.  So there's learning a new thing but then there's taking a thing that you kind of understood  before and then finally you really, really, really understand it.  For example, Katie's talk about the ORM.  Then you need to think about your talk a little bit.  So you want to think about how broad is your topic?  So like I said, for example, testing, you really can't just give a talk about testing  in about half an hour, right?  Like a general topic, a general conference talk is about 25 to 30 minutes.  So think about can I sum up this topic in two minutes to someone who doesn't know very  much about it?  Like hit my high points, get my arc and then you know, okay, I've got a decent idea.  Once you have an idea and you're thinking I am ready, I want to propose this talk, you  want to find the CFP.  CFP stands for call for proposals and the first thing that you want to do is read that  CFP carefully.  Not all CFPs are created equal.  They all have their own special requirements.  They also all have deadlines and it is very unfortunate as an organizer whenever someone  emails you and they said, oh, I'm so sorry, I just missed the deadline.  I had it wrong in my calendar.  You don't want that to be you.  So you want a very close attention to the deadline and also attention to the time zone  that the deadline is in.  Finally, you want to make sure that you know what the anonymity requirements are, right?  So a lot of CFPs require an anonymous submission.  So you might be tempted in your talk to talk about your credentials and there is certainly  place for you to do that but you want to make sure that if this is an anonymous review process  that you're not putting identifiable information in the body of your proposal.  Finally, or not finally, the next step is you actually have to write the CFP, right?  You have to write your proposal, get it ready to submit.  In general, you're going to want a short abstract which is printed in the program or put on  the website that's about 300 characters.  Then you'll want a longer description that gives the organizers a chance to see that  you're prepared to talk on this topic that you know what you're doing.  Sometimes you want an outline, some conferences even want you to have an outline that includes  the time.  So you're going to spend one minute on the introduction and you're going to spend three  minutes talking about this.  Those are kind of annoying but you have to do it anyway.  So make sure again, read the CFP closely and make sure that you're following their prescription.  Then you want to write your bio.  This is the thing that really trips people up.  It is really hard to write about yourself like it sucks a lot.  So there are some tools online that can help you.  I will tweet those later on and you'll notice that my Twitter and a couple of other Twitter  accounts are at the bottom there.  So yeah, you'll want to prepare some kind of statement about yourself that again gets  put on the website, maybe printed in the program to let people know who you are.  Then you'll want to edit your CFP.  So this is before you submit.  Don't just type it all into the window and then hit submit.  You want to run this by somebody.  So you can run this by your friends.  You can run this by colleagues at the place where you work or people that you've worked  with before.  A lot of times conferences will have speaker mentors so you can go to the website or email  the conference and see if that's something that you can take advantage of.  You can reach out on Twitter and say hey, I want to submit a talk on this topic, will  someone review this?  And people will say yes.  They will just say hey, send me the link and they will give you feedback.  Also slacks that you're in are a really great opportunity.  Then you actually hit submit.  And this is a really, really proud moment, right?  But you might have some concerns about speaking at conferences.  So for example, you might wonder if you know enough to present on a topic.  And the answer is yes that you do.  You also might be worried about how much it costs.  A lot of conferences have financial aid.  You might be concerned about your work and whether they'll support you.  You should just ask.  My experience is that a lot of bosses, if you're speaking, will say yes.  And you might wonder if you'll get rejected.  So if you have spoken at a conference, ever raise your hand.  If you have never been rejected from a conference, keep your hand up.  Or like I guess, oh, I'm sorry.  I did that wrong because I'm running out of time.  But basically there are two CFPs that are open right now.  I have two seconds left.  Take a picture of this slide.  And Jenga Khan AU and Jenga Khan.  Thank you very much, Lacey.  Okay.  So we've, Mexican didn't work out.  So our next big, next vendor that he tries out is the Spanish, Spanish vendor.  And inside the Spanish tent, they've got a little tapas bar set up.  So you pick up your own little pieces of tapas from the selections that are there.  And there's a really wide selection of tapas.  Quite impressive.  Not too bad cues going on with what's there.  And the drinks, they're serving sangria, which is lovely.  But again, really long cues on the sangria.  So this is going to be a problem.  It seems to be a recurring theme.  It's like the food doesn't seem to be an issue.  People can get the food out relatively quickly.  But the drinks lines are becoming a bit of a concern.  Are we good to go?  Yes.  All right.  So our next speaker is, I made a clock in Python.  Layla Vohegen.  Take it away.  Hello.  Well, hello.  My name is Layla.  And I will talk to you about making a clock in Python.  So a few months ago, my clock was broken, just like this one.  And I wanted a new one with a few basic requirements.  It had to be blue and the time had to be visible when it was dark.  After searching a lot and only finding red and green ones, I decided to make it myself.  To make this clock, I used an M0 train cut, a Tc module and a blue squad, seven segment  display and each driver.  I also used a breadboard and a lot of wires.  As you can see, I used a medium and a small breadboard.  On the top, it's a circuit without component.  And on the bottom, the thing in the middle, it's a 3.3 volt to 5 volt one way logic converter.  Because the data sheet said the RTC and display drivers needed 5 volts and the train cut outputs  3.3 volts.  But I should have a two way logic converter to this to work and I didn't have one.  In the end, it turns out both the RTC and the display driver work fine with 3.3 volt  signal.  So I got rid of the logic converter altogether.  At this point, I also decided to use a single medium breadboard so I had to make a new circuit.  Both RTC and display drivers come with their own Python module but both modules don't fit  in memory at once.  So I had to write my own time management library to under the RTC module to unsave some memory.  As you can see on this photo, the clock finally works after four days of making circuits and  two hours of writing code.  It was very, very satisfying to see it work.  Well, after my success with the small clock, I know I want a bigger one.  A slightly different one.  I decided to make one with pizza boxes and new pixels.  If you don't know, new pixels are bright RGB led.  Right now, this project is still working in progress because I have time to finish yet  but I think I will work on it after this.  If I talk to you about this clock today, it's because I know that sometimes we want to give  up but I also know that if we preserve, we can climb mountains and even more.  Thank you.  Thank you very much.  Okay.  Here we go.  There we go.  We have another speaker.  So the search continues.  We have tried Mexican.  We have tried the Spanish.  We have tried the American barbecue.  We have tried the Brazilian barbecue.  We have tried the German.  We have all got the same basic problem going on here.  So next, okay, we are going to the Indian tent.  The Indian is a subcontinent India.  There are lots of curries.  Large sort of bain-marie trays filled with all sorts of aromatic curries.  Add a lot of these vegetarian.  They are all still really great food.  One big bowl of rice to serve that as well.  Relatively fast moving cues, getting to all of the curries that are there.  But then there is the drink station.  They are making mango lassies, yogurt drinks.  And again, really long cues on the mango lassie for some reason.  So this probably isn't going to be the one we have got a problem with the long cues again.  So the search continues.  Our next speaker is Lorenzo Peña talking about multi-tenant polymorphic users.  Okay.  Hi, everyone.  My name is Lorenzo Peña.  I am Lorenzo's Twitter, GitHub, Facebook, Gmail and pretty much everywhere.  I come from Holguin, Cuba.  And it's a great privilege to be here today.  Big thanks to the YangoCon crew.  This is my first YangoCon ever.  My first time in Europe.  My second time in South of Cuba.  My first time publicly speaking in English.  And my ninth year in the exciting world of Yango.  I somehow expect that nine to compensate for all the former ones and twos.  The code name for this lightning talk is MTPU, which stands for multi-tenant polymorphic  users, which in turn is a fanciest name I could find to summarize the otherwise longer  quick recipe for creating a simple software as a service with user hierarchies that gratefully  downcast based on the current tenant.  So big disclaimer.  This is just a recipe.  I didn't create any of the ingredients myself.  This is only intended as a phone experiment.  This is no civil bullet for anything.  Consult your doctor before attempting this on production environment.  Ready?  Okay.  Here we go.  We're going to have a project at www.shinydomain.com and we want to build a shiny software as a  service using a single Yango project.  At www.shinydomain.com, we're going to have the corporate site where our customers will  acquire private space at whatever name they choose, shinydomain.com.  So far, so good.  Now come the users.  For most practical cases, we might not want to store the same information for our possible  user types in a project like this.  Think of it at the www site.  We're going to have our corporate users who should be dealing with tenant management  and cool enterprise operations and hopefully, payment processing.  And at www.shinydomain.com, we're going to have the user structure that makes sense at  the application level we're offering as a service and isolated users.  It could be a single user type or it could actually be a hierarchy of user types.  Yango Contrib Alph comes with the fall user model in order to store all relevant information  depending on the user type.  We could fall back to using profile models with one-to-one relationship to the user as  it's still suggested somewhere in the Yango docs.  However, that would take all the fun out of this experiment.  Besides, there's another implicit way of creating one-to-one fields.  So we're going to use a custom user model.  Actually a custom concrete base user model that other user models will inherit to create  a hierarchy.  So cooking time.  Here are our selected ingredients for the MTPU recipe.  For solving the multi-tenancy problem in a single Yango project, we're going to use  Yango tenants.  It relies on Postgres schemas to isolate tenant tables within a single database.  Again, as other packages, the Rallium Postgres schemas, it creates a new schema for every  new tenant while keeping all shared tables in default public schema.  For more ingredients like this, can be found at the Fresh Market, aka yangopackages.com  under the multi-tenancy grid.  And for handling not too complex model hierarchies, we're going to use the Yango Polymorphic.  With this package, if we define models that use concrete inheritance, we can query the  parent models and get the downcasted instances.  So if we have places, restaurants, and bistros, where place is the base class for restaurants  and bistros, we can query places and get not just places instances as vanilla Yango returns,  but the actual type of existing instances.  This comes at the cost of some extra join, some drag in performance, and a little bit  of dark magic.  But shouldn't be a great problem if the hierarchy is not super complicated model tree.  Again, more ingredients like this can be found in the model inheritance grid of yangopackages.com.  So how these ingredients work together.  First, forgetting polymorphic users, we just need to define a custom user model and inherit  polymorphic model.  We might want to inherit also abstract base user to incorporate common user functionality.  Just make sure polymorphic model is the first one in place so that polymorphic behavior  actually works.  We must also define a manager that inherits polymorphic manager and uses default manager  for the base user model.  For Yango tenants to work properly, there are some preliminary steps we need to take  like creating the tenant and domain models.  However, we're going to spare the details here for the sake of time.  The only thing we're going to cover here is tenant and shared application.  Yango tenants has the concept of shared apps and tenant apps.  With this, the regular setting for install apps becomes just an order union of the former.  Models in shared apps will live in the default schema while models in tenant apps will live  in every other schema that is created for the tenant.  If the same app is provided both in shared and tenant apps, its models will live in all  schemas.  But notice in the context of any tenant, tables in tenant schemas will take presence over  those in the public schema.  There is more to talk about this.  We can skip the correct details for now.  So all we just have to do is know where to place everything and since we don't have time  anymore and this we could be inside the cage, I'm just going to leave here proof of concept  if you want to see it in action.  Thank you very much.  Thank you very much.  Thank you very much.  In fact, we have our one last lightning speaker to talk to today while they get set up.  Our intrepid wasp expert is trying to get a little bit desperate.  He is really trying to look for the perfect cuisine that is going to work and be able  to be served quickly to a large wasp enthusiast audience.  And he finally comes across the Australian tent.  The Australian tent is sort of this weird Asian fusion thing.  This is like kangaroo carpaccio and there is emu satay and all sorts of weird combinations  of Australian food or Australian native animals that are done in a sort of vaguely Asian sort  of style which is unusual.  There are still people here so obviously it can't be bad.  He lines up and he gets in the queue and says this food is really, really good.  It's been expertly prepared and it comes out quickly.  And then he goes over and looks for the drink situation.  And they are serving a fruit punch.  There is a native Australian fruit punch.  Which sounds good but there is no line.  There is no line at all.  This is weird.  I have to work out what is going on here.  Our next speaker is Daniel Hepburn talking about the hidden powers of custom Django path  inverters.  Hi, I am Daniel and I want to show you a somewhat obscure feature that is new in Django 2.0.  So who read the release notes?  What is new in Django 2.0?  Yay, no more regular expressions in URLs.  We have a simplified URL routing syntax.  Instead of using URL with a regular expression in it, use the path method to capture an URL  argument, use angle brackets.  After the column, that is the name of the argument and before the column, that is a  so-called path converter which you can define.  So path converter converts.  So in this case, it converts the argument into an integer.  So your view will actually get an integer and not a string as it used to be.  So there are a couple of built-in path converters.  Under the hood, they still use a regular expression.  So string integers, lock path and also UUID.  But now you might say, wait a minute, that is not really a feature equivalent, regular  expression that accepts exactly four digits and an integer can be like any number of digits,  basically.  So that is where custom path converters come into play.  It is a plain class that has, again, a regular expression.  So if you hate regular expression, kind of bad news.  And it has a two-python method which handles the converting from the URL to the Python  object.  And it has a two-URL method which handles the reversal.  So now for our four-digit URL pattern, that is the custom path converter.  To use it, you have to register it and give it a name.  And the name is what you then use in URL.  So far so good.  That's all in the documentation.  But this line called myI, it says it should raise a value error if it can't convert a  given value.  But it doesn't say is what happens when that value error gets raised.  You might expect that you get a server error or something like that.  But actually, the conversion is part of the matching.  So if a value error gets raised, the path just doesn't match.  So how can we use it?  Let's say we have a URL which gets an ID.  And then you have a view which gets an object or returns a 404.  And you also have a URL tag in a template that does the reversal.  Now you can write a custom converter class which fetches the object in the two-python  method and raises a value error if the object doesn't exist.  And the URL method just takes a return to the ID of the object.  You register that converter and give it a name.  In this case, I was not very creative.  So it's a question converter.  And now your view receives a question object.  And you can also just pass a question object to your URL reversal.  Now you don't want to write a converter for each model, obviously.  So you can generalize that, and I wrote a register model converter method which dynamically  builds a model converter class which you can use like this.  And by default, it just uses the name of the model as the name of the converter.  Then I came up with a couple of other useful features like passing an optional name and  using a different field for lookup and using a different base class.  For example, your primary key is a UID, you can also pass a query set.  That's where the advertising part starts.  I packaged that in a Python package which you can just install with pip install Django  model path converter.  And then you just do register model converter with your model class.  And then you have models in your view.  Here are the links to the pipi and GitHub and also my Twitter and my email if you want  to tell me why that's a bad idea.  Thank you.  Thank you very much.  That concludes the lightning talks for today.  Thank you very much to all the lightning talk speakers.  Thank you very much to our delightful Gonging person who didn't have a great deal of need  to Gong because everybody was under time.  It's wonderful.  One last issue we have to work out is why was the Australian queue able to get through  the drinks so quickly?  So the guy who is organizing the wasp con goes to find the manager of the Australian  tents.  So what's the story here?  What's going on?  Everyone else.  I've been to all these other tents.  I've been to Mexican tents.  I've been to American tents.  I've been to Brazilian tents.  They've all got good rates of throughput for the food but they've got huge, huge lines  for the drinks.  And I come in here and you're serving this delicious punch which is fantastic.  But there's no queue.  So what's the story?  And so the Australian manager turns to the guy and looks him straight in the eye and says,  why would there be a punch line?
DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__0_503.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__504_1043.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__1044_1463.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__1464_1763.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__1764_1895.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__1896_7103.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__7104_7163.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__7164_7523.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__7524_11351.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__11352_11459.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__11460_13715.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__13716_13991.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__13992_14159.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__14160_14627.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__14628_14723.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__14724_16391.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__16392_16547.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__16548_17291.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__17292_17387.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__17388_18671.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__18672_20099.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__20100_24527.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__24528_24863.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__24864_28151.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__28152_32483.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__32484_32579.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__32580_33875.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__33876_34175.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__34176_36311.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__36312_39767.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__39768_40091.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__40092_41543.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__41544_41687.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__41688_48731.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__48732_48791.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__48792_49307.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__49308_49487.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__49488_50447.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__50448_55367.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__55368_56807.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__56808_58175.png DjangoCon_2018_-_Lightning_Talks_II__1080p_25fps_H264-128kbit_AAC__58176_58387.png
As a last point today, we have lightning talks again, and I think we were all looking forward to that. So I'll just hand it off to Russ again. All right. It's time for lightning talks again. So we all remember from yesterday what the deal is. Five minutes, no more, but can be less if you want to. And we do like people who do less because it means you get more talks through. There is a gong over here that will be attended to by my lovely assistant who will make sure that whoever is over here gets the message whenever their time is up. There is a timer down here we're keeping time to, and while we sit here and wait for people to get their AV set up, I get to regale you with delightful stories about the individual yesterday who went and was dealing with the wasps after meeting the head of the WOSP con as an expert WOSP observer, got involved with the organization of WOSP con and catering is a very big important part of any conference as we all know, but stories of this will progress. First up on stage we have Peter Kearnar talking about recording lectures with Python and G-Streamer. Everyone please welcome. Thank you very much. Hi Peter, I would like to give you a small introduction to the Huston hardware we're using here in this venue and a lot of other conferences to record live streams of lectures and doing live streaming and recording. I can switch my slides. I'm from C3 Rock. We are the video operation center of the CCC. You can find tons of information about video recording and streaming and production and distribution in our wiki and it's really not all that cleaned up, but it contains tons of information you can find me personally under this nickname on Twitter. This is part of our pipeline. It's only half of it. The upper half is concerned with capturing video signals from speaker notebooks and audio and video signals from the cameras around the lecture room. All those signals are then fed into a Vokto mix. That's these parts and it's a Python and G-Streamer based mixer solution. You can see from the schematic that it's basically split into two halves. One is Vokto Core. It's like a headless server and the other one is Vokto GUI. This is the streaming diagram, block diagram of Vokto Core. It basically acts as a network server accepting and providing video feeds on TCP ports. The mixing pipeline we implemented is very specific for lecture recording. You can transmit a nice pause animation and some elevator music during a break while continuing to recording the actual content. If you accidentally miss hitting the go live button, you still have a useful recording. The mixing pipeline also can handle multiple audio feeds for live translations, for example, and it probably can be extended to other nifty, crazy stuff. From the code perspective, it basically looks like this. We are plugging together G-Streamer pipelines in Python as strings and then giving them to G-Streamer to parse them. G-Streamer then implements, builds a multimedia pipeline from it. It's like Lego for audio and video. You stick together the pieces you need. The UI looks like this. It connects to Vokto Core via TCP network and when you press a button, it sends commands over there over a simple line-based protocol. So writing new GUIs or other interfaces is quite easy. You can literally mix video with Netcat and Telnet. It's really trivial to automate. Just one example is these little guys. We have them here on our cameras. They are Raspberry Pis that connect to the Vokto Core and receive the line-based protocol and turn the light on the LED on whenever the camera is live. You can find all the code and a lot of the documentation in GitHub. And if you want to talk to us and have questions, please visit us. We are upstairs there. If you go upstairs, please be a little bit quiet. Oh, they're ringing. Ring again. Whee! If you go upstairs, please be quiet. But you can always talk to us and we're really open and welcome to explain to you what we're doing. And because we have a really nice setup here, I have some pictures. This is the main camera that's right there in the middle of you. We have a second camera above there. And we also have, like, this is a really nice view from our mixing console upstairs. So thank you very much. And if you have any questions, please approach us and we will explain you how to set up your own video recording for your own conferences. Thank you very much. Thank you very much, Peter, while we get our next speaker set up. So this guy gets the job to organize the conference catering. So he goes out to essentially a conference conference to go and forget where all the vendors turn up and show their wares and talk about what they can do and what they can provide for your conference. And this place has got tents set up and every vendor has their own tent where they can demonstrate how they can serve food and how much food they can serve and what have you. And so he turns up and he sort of walks into the first tent. And the first tent is selling essentially German themed food. There's like a selection of a verset and sauerkraut and homemade mustards. And there's some decent queues, people lining up to get in there. And then there's some really, really long queues because they're also serving beer in the tent and the longest queue is to get to the beer. So this guy just stands there and he tries the food. Yeah, this is all very good food, but the queues are a bit of a problem, particularly the long lines for the drinks. People are willing to wait for food for a little bit, but you really don't want to get them waiting too long for a drink. So okay, maybe I'll try again. I'll try and try another location, another one of the tents and see where that's going to be better suited to our needs. So he goes on to the next tent. The next tent is an American barbecue themed tent. They've got all sorts of different barbecues, Southern barbecue, Texas barbecue, Kansas barbecue. They don't ever get into a barbecue discussion with an American. They get very, very techy about barbecue. And there's all this barbecue and there's fresh coleslaw. There's some decent queues. Again, people lining up and getting their food, getting their barbecue. But then there's some freshly squeezed lemonade as the drink that they're offering there. And again, really long queues for this fresh squeezed lemonade because it's really good, but also it just takes a while to produce to get a good glass of lemonade. So there's these long queues and the guy's in there and he tries it out and it's the food's really good. Barbecue's really good, good selection of barbecue and the coleslaw that goes with it's really good as well. And still going. All right. And again, the lemonade is refreshing and it's tasty. But again, really long lines to get yourself a drink. So okay, it's probably not going to be the one for us. Are we... Nope. All right. So he tries the next tent. I'm moving through far too many of my tents here. I'm going to have to convince some new tents. He gets through the next tent. The next tent is a different type of barbecue. This is Brazilian barbecue. So Brazilian barbecue, if you don't know, is basically all about meat. Brazilians really do like their meat. So he goes in and he says, okay, yes, here we go. Some beautiful meat on the great big skewers. Have you ever been to a church here? It's a fantastic way of having Brazilian barbecue. And the vendors there are slicing big pieces of meat off of the skewers and serving to each of the individual patrons as they turn up. Being Brazilian though, there is no salad that goes with it. It's just the meat. And they've also got... No, I'm still waiting for... Yeah, okay, we're still going. He's going through the... They've got a caparinha station there. The Brazilians, they do make a very good caparinha made out of really good imported cassaca. Delicious. But again, reasonable queues for the food. They can get the food out going out relatively quickly. But the drink station, it takes a while to mix a good caparinha. So there's really, really long lines for the caparinhas. And so he moves on to the next tent. Next tent is an Italian themed tent. Have we got an ETA at all? I'm with... Yeah, so it's an Italian themed tent. And it goes in there and as you predict, the pastas and meals like that with some nice salads on the side as well. This was not the agreed pattern. This is going to turn into a five minute joke in between all the others. All right, so we're getting another laptop line up. So it's the Italian themed booth. We have the Italian themed meal. We've got the pastas and the pastas are all there and some salads. And of course, it's Italian, so we've got some good red wine there and they've got the red wine coming out. But again, decent queues for the food. People are moving the food through relatively quickly. But then the lines for the drinks, for this red wine, really, really long lines as everybody gets their drinks. This is a possibility. I might get a breather here. We're getting close. We're waiting for flashes. Okay. So, okay, the guy organising this conference is starting to get a little bit concerned. It seems to be a recurring theme here. We sort of go into all these booths. Really, really good creative food vendors producing really, really tasty food. But there's long lines at every drink station that they turn up to. And they have full screen. And they have full screen. And they have full screen. That's the line up there. Yeah, there we go. All right. But you can tell that he's going to have to keep looking. I'm going to have to keep looking as well to see if he can find the vendor that's going to be right for him. And are we going to download the whole, okay. And then it will work. There we go. All right. So the search will continue after the break. Next we run up here on stage now. We have Arne Delat with cosmic ray research with data analysis via Django and some astroparticle physics. Take it away, Arne. Good afternoon. I now work at local doing web development. My previous job was doing astroparticle physics at NICF in Amsterdam. There I analyzed stuff with supernova. So this is an image of a supernova explosion where a star explodes. The shell of particles being ejected by the supernova accelerates particles which are just out there in space. It picks them up and accelerates them. And using big magnets it keeps them until they're fast enough and then it checks them all throughout space. Some of those particles moving at almost the speed of light hit the earth. Then this happens. There's a particle at the top and it hits another particle in our atmosphere. And there's so much energy that they create more particles and those particles have enough energy to collide again and create more particles until you have on the ground maybe between one and several billion particles. Those are just electrons, muons which are the slightly heavier version of electrons. And there's, you know, at high spark we detect those particles. So in the top right you see a scintillator which glows a bit if those particles go through it. We wrap those in light-tight plastic and then we put them in those key boxes. And there are photo multipliers connected which see the scintillator glow and they convert that to a strong electrical signal. Then you have the little box on the lower left and it converts electrical signals into bits and bytes and it continuously reads out the signal every two and a half nanoseconds. So you get this really sharp signal. And then we put several of those detectors very close together so you can see if multiple of them are hit then you are dealing with one of those air showers. If only one sees something then it's probably some background radiation. Not interesting. So this is how the network looks like. You have huge things in space which shoot out these cosmic rays. These cosmic rays interact in our atmosphere and we have several detector stations and they detect these events. All the data is sent to the NICF in Amsterdam where we do a bunch of data analysis and there's this nice Django application which does all the bookkeeping and manages all this. So there are about 100 of these detection stations. Most of them are at high schools. So it's an outreach project. High school students build these detectors. They put them on the roof of their schools and they can then work with the data from their station, from all the other stations and do nice experiments, see what they can learn about relativity, quantum physics and other interesting stuff. This is an example of an event at the Science Park in Amsterdam where there are several stations very close together. The color indicates the arrival time so more blue is earlier, redder is later. So you have this one particle coming from outer space. It creates all these new particles and they all go at the speed of light. So basically if you take a snapshot it's all these particles in a flat plane so they also hit the ground in that plane. So first they hit on the right and then a bit later there and there and there and there. So using that timing difference you can get a sense of the direction of this air shower and using the number of particles which is indicated by the size of the blobs. You can guess where the center of the core was and then you know something about the energy of the air shower, you know something about the energy of the cosmic ray and you might guess where it came from with the direction. It's all very interesting. So we have a lot of teaching material and tools for these high school students to work with this data. A lot of documentation, all the code is open source so the code running on the detection stations, the Django that's managing all the data coming in. This project has been running since 2004. There's about six billion events that have been detected which is about six terabytes of data which is then reduced, reconstructed and all the data is made available via nice APIs and we provide a nice JavaScript tools to do stuff with it and Python framework to also do analysis with it. It's all very nice. And yeah, this used to be a movie but now it's a PDF because it was on my laptop and maybe I can show it quickly. Oh, where's the slash there? All right. Thank you very much, Arnie. So whilst our next speaker gets set up, the search continues for the perfect conference food. So having been to the German tent and the Italian tent and the Brazilian tent and the US barbecue tent, the guy walks on to the next tent. The next tent is a Mexican tent. They've got a little taco truck set up in there. Behind the counter, furiously making tacos for everybody and they're beautiful. Fish tacos and chicken tacos and beef tacos and they're all fantastic. And then I've got a little margarita stand on the side. So they're making margaritas for everybody to drink while they're at it. And are we good to go? So again, we've got long lines for the margaritas but the rest of the food goes through well. But the long lines are a problem. We need to look somewhere else. Next speaker is Lacey Williams-Henshaw talking about how to propose a talk. We want to welcome. I have to figure out where to stand because I'm really short. But I don't have a clicker either. So yeah, I want to talk to you about how to propose a conference talk because I work on conferences and I speak at conferences and so I've done this a few times. I need to stay over here though so the mic catches me. So the first thing that you need to do a conference talk, oh, there's the timer over there, that's nice, is an idea, right? And so where do you get ideas? So you can think about what have you learned recently? My personal opinion is that the most qualified person to speak on a given topic is the person who was most recently completely perplexed by that topic because you know what you had to do to get over that hump to figure out how to understand that. Sometimes you have really strong opinions about something. You think that testing should be done a very particular way or you think that code should be organized in this very, very specific way. You can share those very strong opinions with a group. Sometimes something that really confuses you now makes sense to you. So again, this is related to one but it's also its own separate thing. So there's learning a new thing but then there's taking a thing that you kind of understood before and then finally you really, really, really understand it. For example, Katie's talk about the ORM. Then you need to think about your talk a little bit. So you want to think about how broad is your topic? So like I said, for example, testing, you really can't just give a talk about testing in about half an hour, right? Like a general topic, a general conference talk is about 25 to 30 minutes. So think about can I sum up this topic in two minutes to someone who doesn't know very much about it? Like hit my high points, get my arc and then you know, okay, I've got a decent idea. Once you have an idea and you're thinking I am ready, I want to propose this talk, you want to find the CFP. CFP stands for call for proposals and the first thing that you want to do is read that CFP carefully. Not all CFPs are created equal. They all have their own special requirements. They also all have deadlines and it is very unfortunate as an organizer whenever someone emails you and they said, oh, I'm so sorry, I just missed the deadline. I had it wrong in my calendar. You don't want that to be you. So you want a very close attention to the deadline and also attention to the time zone that the deadline is in. Finally, you want to make sure that you know what the anonymity requirements are, right? So a lot of CFPs require an anonymous submission. So you might be tempted in your talk to talk about your credentials and there is certainly place for you to do that but you want to make sure that if this is an anonymous review process that you're not putting identifiable information in the body of your proposal. Finally, or not finally, the next step is you actually have to write the CFP, right? You have to write your proposal, get it ready to submit. In general, you're going to want a short abstract which is printed in the program or put on the website that's about 300 characters. Then you'll want a longer description that gives the organizers a chance to see that you're prepared to talk on this topic that you know what you're doing. Sometimes you want an outline, some conferences even want you to have an outline that includes the time. So you're going to spend one minute on the introduction and you're going to spend three minutes talking about this. Those are kind of annoying but you have to do it anyway. So make sure again, read the CFP closely and make sure that you're following their prescription. Then you want to write your bio. This is the thing that really trips people up. It is really hard to write about yourself like it sucks a lot. So there are some tools online that can help you. I will tweet those later on and you'll notice that my Twitter and a couple of other Twitter accounts are at the bottom there. So yeah, you'll want to prepare some kind of statement about yourself that again gets put on the website, maybe printed in the program to let people know who you are. Then you'll want to edit your CFP. So this is before you submit. Don't just type it all into the window and then hit submit. You want to run this by somebody. So you can run this by your friends. You can run this by colleagues at the place where you work or people that you've worked with before. A lot of times conferences will have speaker mentors so you can go to the website or email the conference and see if that's something that you can take advantage of. You can reach out on Twitter and say hey, I want to submit a talk on this topic, will someone review this? And people will say yes. They will just say hey, send me the link and they will give you feedback. Also slacks that you're in are a really great opportunity. Then you actually hit submit. And this is a really, really proud moment, right? But you might have some concerns about speaking at conferences. So for example, you might wonder if you know enough to present on a topic. And the answer is yes that you do. You also might be worried about how much it costs. A lot of conferences have financial aid. You might be concerned about your work and whether they'll support you. You should just ask. My experience is that a lot of bosses, if you're speaking, will say yes. And you might wonder if you'll get rejected. So if you have spoken at a conference, ever raise your hand. If you have never been rejected from a conference, keep your hand up. Or like I guess, oh, I'm sorry. I did that wrong because I'm running out of time. But basically there are two CFPs that are open right now. I have two seconds left. Take a picture of this slide. And Jenga Khan AU and Jenga Khan. Thank you very much, Lacey. Okay. So we've, Mexican didn't work out. So our next big, next vendor that he tries out is the Spanish, Spanish vendor. And inside the Spanish tent, they've got a little tapas bar set up. So you pick up your own little pieces of tapas from the selections that are there. And there's a really wide selection of tapas. Quite impressive. Not too bad cues going on with what's there. And the drinks, they're serving sangria, which is lovely. But again, really long cues on the sangria. So this is going to be a problem. It seems to be a recurring theme. It's like the food doesn't seem to be an issue. People can get the food out relatively quickly. But the drinks lines are becoming a bit of a concern. Are we good to go? Yes. All right. So our next speaker is, I made a clock in Python. Layla Vohegen. Take it away. Hello. Well, hello. My name is Layla. And I will talk to you about making a clock in Python. So a few months ago, my clock was broken, just like this one. And I wanted a new one with a few basic requirements. It had to be blue and the time had to be visible when it was dark. After searching a lot and only finding red and green ones, I decided to make it myself. To make this clock, I used an M0 train cut, a Tc module and a blue squad, seven segment display and each driver. I also used a breadboard and a lot of wires. As you can see, I used a medium and a small breadboard. On the top, it's a circuit without component. And on the bottom, the thing in the middle, it's a 3.3 volt to 5 volt one way logic converter. Because the data sheet said the RTC and display drivers needed 5 volts and the train cut outputs 3.3 volts. But I should have a two way logic converter to this to work and I didn't have one. In the end, it turns out both the RTC and the display driver work fine with 3.3 volt signal. So I got rid of the logic converter altogether. At this point, I also decided to use a single medium breadboard so I had to make a new circuit. Both RTC and display drivers come with their own Python module but both modules don't fit in memory at once. So I had to write my own time management library to under the RTC module to unsave some memory. As you can see on this photo, the clock finally works after four days of making circuits and two hours of writing code. It was very, very satisfying to see it work. Well, after my success with the small clock, I know I want a bigger one. A slightly different one. I decided to make one with pizza boxes and new pixels. If you don't know, new pixels are bright RGB led. Right now, this project is still working in progress because I have time to finish yet but I think I will work on it after this. If I talk to you about this clock today, it's because I know that sometimes we want to give up but I also know that if we preserve, we can climb mountains and even more. Thank you. Thank you very much. Okay. Here we go. There we go. We have another speaker. So the search continues. We have tried Mexican. We have tried the Spanish. We have tried the American barbecue. We have tried the Brazilian barbecue. We have tried the German. We have all got the same basic problem going on here. So next, okay, we are going to the Indian tent. The Indian is a subcontinent India. There are lots of curries. Large sort of bain-marie trays filled with all sorts of aromatic curries. Add a lot of these vegetarian. They are all still really great food. One big bowl of rice to serve that as well. Relatively fast moving cues, getting to all of the curries that are there. But then there is the drink station. They are making mango lassies, yogurt drinks. And again, really long cues on the mango lassie for some reason. So this probably isn't going to be the one we have got a problem with the long cues again. So the search continues. Our next speaker is Lorenzo Peña talking about multi-tenant polymorphic users. Okay. Hi, everyone. My name is Lorenzo Peña. I am Lorenzo's Twitter, GitHub, Facebook, Gmail and pretty much everywhere. I come from Holguin, Cuba. And it's a great privilege to be here today. Big thanks to the YangoCon crew. This is my first YangoCon ever. My first time in Europe. My second time in South of Cuba. My first time publicly speaking in English. And my ninth year in the exciting world of Yango. I somehow expect that nine to compensate for all the former ones and twos. The code name for this lightning talk is MTPU, which stands for multi-tenant polymorphic users, which in turn is a fanciest name I could find to summarize the otherwise longer quick recipe for creating a simple software as a service with user hierarchies that gratefully downcast based on the current tenant. So big disclaimer. This is just a recipe. I didn't create any of the ingredients myself. This is only intended as a phone experiment. This is no civil bullet for anything. Consult your doctor before attempting this on production environment. Ready? Okay. Here we go. We're going to have a project at www.shinydomain.com and we want to build a shiny software as a service using a single Yango project. At www.shinydomain.com, we're going to have the corporate site where our customers will acquire private space at whatever name they choose, shinydomain.com. So far, so good. Now come the users. For most practical cases, we might not want to store the same information for our possible user types in a project like this. Think of it at the www site. We're going to have our corporate users who should be dealing with tenant management and cool enterprise operations and hopefully, payment processing. And at www.shinydomain.com, we're going to have the user structure that makes sense at the application level we're offering as a service and isolated users. It could be a single user type or it could actually be a hierarchy of user types. Yango Contrib Alph comes with the fall user model in order to store all relevant information depending on the user type. We could fall back to using profile models with one-to-one relationship to the user as it's still suggested somewhere in the Yango docs. However, that would take all the fun out of this experiment. Besides, there's another implicit way of creating one-to-one fields. So we're going to use a custom user model. Actually a custom concrete base user model that other user models will inherit to create a hierarchy. So cooking time. Here are our selected ingredients for the MTPU recipe. For solving the multi-tenancy problem in a single Yango project, we're going to use Yango tenants. It relies on Postgres schemas to isolate tenant tables within a single database. Again, as other packages, the Rallium Postgres schemas, it creates a new schema for every new tenant while keeping all shared tables in default public schema. For more ingredients like this, can be found at the Fresh Market, aka yangopackages.com under the multi-tenancy grid. And for handling not too complex model hierarchies, we're going to use the Yango Polymorphic. With this package, if we define models that use concrete inheritance, we can query the parent models and get the downcasted instances. So if we have places, restaurants, and bistros, where place is the base class for restaurants and bistros, we can query places and get not just places instances as vanilla Yango returns, but the actual type of existing instances. This comes at the cost of some extra join, some drag in performance, and a little bit of dark magic. But shouldn't be a great problem if the hierarchy is not super complicated model tree. Again, more ingredients like this can be found in the model inheritance grid of yangopackages.com. So how these ingredients work together. First, forgetting polymorphic users, we just need to define a custom user model and inherit polymorphic model. We might want to inherit also abstract base user to incorporate common user functionality. Just make sure polymorphic model is the first one in place so that polymorphic behavior actually works. We must also define a manager that inherits polymorphic manager and uses default manager for the base user model. For Yango tenants to work properly, there are some preliminary steps we need to take like creating the tenant and domain models. However, we're going to spare the details here for the sake of time. The only thing we're going to cover here is tenant and shared application. Yango tenants has the concept of shared apps and tenant apps. With this, the regular setting for install apps becomes just an order union of the former. Models in shared apps will live in the default schema while models in tenant apps will live in every other schema that is created for the tenant. If the same app is provided both in shared and tenant apps, its models will live in all schemas. But notice in the context of any tenant, tables in tenant schemas will take presence over those in the public schema. There is more to talk about this. We can skip the correct details for now. So all we just have to do is know where to place everything and since we don't have time anymore and this we could be inside the cage, I'm just going to leave here proof of concept if you want to see it in action. Thank you very much. Thank you very much. Thank you very much. In fact, we have our one last lightning speaker to talk to today while they get set up. Our intrepid wasp expert is trying to get a little bit desperate. He is really trying to look for the perfect cuisine that is going to work and be able to be served quickly to a large wasp enthusiast audience. And he finally comes across the Australian tent. The Australian tent is sort of this weird Asian fusion thing. This is like kangaroo carpaccio and there is emu satay and all sorts of weird combinations of Australian food or Australian native animals that are done in a sort of vaguely Asian sort of style which is unusual. There are still people here so obviously it can't be bad. He lines up and he gets in the queue and says this food is really, really good. It's been expertly prepared and it comes out quickly. And then he goes over and looks for the drink situation. And they are serving a fruit punch. There is a native Australian fruit punch. Which sounds good but there is no line. There is no line at all. This is weird. I have to work out what is going on here. Our next speaker is Daniel Hepburn talking about the hidden powers of custom Django path inverters. Hi, I am Daniel and I want to show you a somewhat obscure feature that is new in Django 2.0. So who read the release notes? What is new in Django 2.0? Yay, no more regular expressions in URLs. We have a simplified URL routing syntax. Instead of using URL with a regular expression in it, use the path method to capture an URL argument, use angle brackets. After the column, that is the name of the argument and before the column, that is a so-called path converter which you can define. So path converter converts. So in this case, it converts the argument into an integer. So your view will actually get an integer and not a string as it used to be. So there are a couple of built-in path converters. Under the hood, they still use a regular expression. So string integers, lock path and also UUID. But now you might say, wait a minute, that is not really a feature equivalent, regular expression that accepts exactly four digits and an integer can be like any number of digits, basically. So that is where custom path converters come into play. It is a plain class that has, again, a regular expression. So if you hate regular expression, kind of bad news. And it has a two-python method which handles the converting from the URL to the Python object. And it has a two-URL method which handles the reversal. So now for our four-digit URL pattern, that is the custom path converter. To use it, you have to register it and give it a name. And the name is what you then use in URL. So far so good. That's all in the documentation. But this line called myI, it says it should raise a value error if it can't convert a given value. But it doesn't say is what happens when that value error gets raised. You might expect that you get a server error or something like that. But actually, the conversion is part of the matching. So if a value error gets raised, the path just doesn't match. So how can we use it? Let's say we have a URL which gets an ID. And then you have a view which gets an object or returns a 404. And you also have a URL tag in a template that does the reversal. Now you can write a custom converter class which fetches the object in the two-python method and raises a value error if the object doesn't exist. And the URL method just takes a return to the ID of the object. You register that converter and give it a name. In this case, I was not very creative. So it's a question converter. And now your view receives a question object. And you can also just pass a question object to your URL reversal. Now you don't want to write a converter for each model, obviously. So you can generalize that, and I wrote a register model converter method which dynamically builds a model converter class which you can use like this. And by default, it just uses the name of the model as the name of the converter. Then I came up with a couple of other useful features like passing an optional name and using a different field for lookup and using a different base class. For example, your primary key is a UID, you can also pass a query set. That's where the advertising part starts. I packaged that in a Python package which you can just install with pip install Django model path converter. And then you just do register model converter with your model class. And then you have models in your view. Here are the links to the pipi and GitHub and also my Twitter and my email if you want to tell me why that's a bad idea. Thank you. Thank you very much. That concludes the lightning talks for today. Thank you very much to all the lightning talk speakers. Thank you very much to our delightful Gonging person who didn't have a great deal of need to Gong because everybody was under time. It's wonderful. One last issue we have to work out is why was the Australian queue able to get through the drinks so quickly? So the guy who is organizing the wasp con goes to find the manager of the Australian tents. So what's the story here? What's going on? Everyone else. I've been to all these other tents. I've been to Mexican tents. I've been to American tents. I've been to Brazilian tents. They've all got good rates of throughput for the food but they've got huge, huge lines for the drinks. And I come in here and you're serving this delicious punch which is fantastic. But there's no queue. So what's the story? And so the Australian manager turns to the guy and looks him straight in the eye and says, why would there be a punch line?
about recording lectures with Python and together G-Streamer pipelines in Python as longer quick recipe for creating a simple software as a service with user hierarchies that gratefully downcast based on the current tenant. Hepburn talking about the hidden powers of custom