Raphael is the founder of pretix, an open-source ticketing platform. We discuss its early iterations, the technical challenges of ticketing, using Celery and Django REST Framework, DecimalField vs IntegerField for currency, and more.
Carlton Gibson 0:06
Hi. Welcome to another episode of Django Chat, a podcast on the Django web framework. I'm Carlton Gibson. Joined us over by Will Vincent,. Hello. Will
Will Vincent 0:12
Hi, Carlton,
Carlton Gibson 0:14
Hello, Will. And joining us today, we've got Raphael Michel. Hello. Raphael, thank you for coming on the show.
Raphael Michel 0:20
Hi. Thanks for having me.
Carlton Gibson 0:21
No, I'm really excited to talk to you. I so I know you first from DjangoCon Europe, back in Heidelberg, really. But before we get into it, tell us a little bit about who yourself, about yourself, and how you got How did you find Django?
Raphael Michel 0:36
How did I find Django? I think that's an interesting story. I haven't thought about it in a long time. I think was student at high school, and I was doing a lot of web development on the side as a hobby, later, a small mini job, and there was this German website that sold T shirts with it motives, and they had on their Twitter account. Back when Twitter was a thing, right? They had, I think it was a raffle for a free T shirt. I don't remember what you needed to do for it. But I, I entered into the raffle, and I don't even remember if I've if I won, but some of us, the CEO of that company, looked at my website and was impressed by this 15 year old doing web development and offered me an internship that I didn't take because it was in a city at the other end, on the other end of the country. But I think that internship description was the first time I saw that Django is a thing, and it kind of made me look into what that is, right? Okay, so that's quite good, because that's almost like the universe aligning the planets there for you, right? Yeah, absolutely. I thought you, I thought you were going to say you'd won the t shirt. I think I've got a t shirt after all that. I'm not sure if I've officially won it or but it made me look into into Python first, and then later into Django. I think starting 2013 I've every new project I touched became a Django project instead of a PHP project.
Carlton Gibson 2:28
Okay, so you did, you did the PHP to put Django maneuver. Yeah, we should get a support group for
Will Vincent 2:35
Well, I think the docs are still heavily there's an assumption built in that you're coming from PHP, because back when, you know Adrian and everyone else wrote them, that's what, that's what the move was, yeah, possibly, yeah. PHP also has changed a lot, or how people use it has changed a lot since then. I think they, maybe they used to be quite similar back then, and maybe they are more similar today than they were in the time between.
Raphael Michel 3:04
But I'm not using it anymore. This I had one remaining PHP project until, like, two or three years ago, but now it's all gone. Okay? So, I mean, there's two things that linger right? One is in the request object, you've got the capital get and the capital post from which is explicitly PHP, and then the other is the the the template tag for formatting a date. It uses miraculous. It uses the PHP and so you always have to look it up, because it's not like anything else you use at any other type. Well, I'm I'm going later this week to see a friend, a meet up here in Boston, and a friend who uses Laravel, and he's just the biggest evangelist ever for Laravel, and has been for a while, and so through him, I've been hearing for years, just about all the changes. I mean, Laravel really seems to have given PHP a second, second wave, if you will. I know PHP, the language itself, adopted some Pythonic features, and then Laravel is especially for consultancies, has a lot of a lot of features, and in some ways, is a little bit easier than Django, in terms of, you know, cookie cutter kind of stuff. It has built in temp hosting solution. It's got a starter project, and it has, you know, one person in charge, essentially, which means they can go a lot faster than we can in Django world. And at least for some target groups that develop the deployment story for PHP is still simpler, but still, they will put your files there and it works. Yeah. I mean, right. I mean, that's the, that's the original appeal of PHP. And then I think the fact that there's a hosted, official solution means, if you're an agency, for sure, just and, yeah, Taylor, I think that the Creator has talked openly. I think it's just a couple big boxes he's got running millions of dollars a year of hosted stuff. So just think, if, just think, if Django had something like that.
Carlton Gibson 5:02
Anyways, so I'd ask you though, Rafa, you've been so you've been using Django for well over a decade now, and this, this question comes up quite often, should we cop should we copy things from Laravel? Should we copy things from Rails? Should we do, you know, should we do that? Are there things that stand out for you that we should be doing as an ecosystem.
Raphael Michel 5:19
That we're not I'm not so sure, probably something I would need to think about more. But also I'm not monitoring the other ecosystems. But Well, for me, Django very much fits how my brain works, similar to like in the JavaScript word Vue fits my brain model a lot better than react. For example, I don't know why I've worked with both, and one feels natural to me and the other one doesn't. And there is,after a decade I have, I've settled in the Django ecosystem so much that, like it doesn't bother me anymore. If anybody's anything is missing, because I have my strategy how to deal with it for a while. Yeah, right. So you've got your solution, and that's what you do. Obviously, there's things that aren't perfect, talking about deployment, talking about assets, pipelines, talking about lots of other stuff. I think those in our secrets. But I'm also not aware of other ecosystems where I would say, Okay, this is, I've seen this. This perfect. We should copy that, right?
Will Vincent 6:28
Okay, good. Let me ask, let me ask you about authentication, because Carlton, I have been making a bit of a stink around this recently. How, how do you like to handle authentication? And we'll get to you have various projects that, you know, yeah, scale and not that seems to me to be one of the ones where there isn't, there isn't one solution for the community. So how do you like to handle user auth?
Raphael Michel 6:51
So the thing is that I, I don't work in the in the agency world, with setting up three new projects per year and needing, needing lots of, yeah, lots of reproducibility, or lots of plug ability. I work with long, long standing projects that are quite complex and developed over long time frames. And so I find that all the packages that try to do authentication for you are too opinionated or too specific. Don't fit into my products as much as I wanted to. So for the large products I'm working on, going with playing Django and building everything on top myself or ourselves? Yes, I have implemented OpenID Connect from scratch before. It's not something I would recommend, but
Carlton Gibson 7:51
the tear of the blood that drips down as you say that
Raphael Michel 7:55
there's we have a few other projects where this bothers me, like we have an internal we have a few internal tools built with Django. For example, we run also our company invoicing on Django, basically on the Django admin. And we have a tool that manages the like something like a package repository for for the software that we develop or deliver to our clients. It's also a small Django project, and for those smaller projects, what I'm missing is, for example, good two factor support. So I'm using one of these packages, one of the many packages for two factor that I can, just like, put into my installed apps. And it works and but it doesn't work very well, and it's not very nicely integrated. Then the templates look different and it's it's not really, not really the best thing or the best solution to the problem. I think what I would rather want to see there would be better low level batteries for that included in Django, like a Base View to do T, OTP and webauthn authentication, and then have me bring my own templates, like I bring my own login template because it should look like the rest of my application.
Carlton Gibson 9:15
Yeah, right, yeah, no. I mean, Andrew Godwin had this line about the batteries included, thing that Django should provide, the hard batteries like and let everyone else produce it, the easier ones and and those kind of low level views. They're the hard things that you have to get right and then. But then the templates. There's no reason for us to have an opinion on that.
Raphael Michel 9:37
No, that's super I wanted to.
Carlton Gibson 9:39
We want to go on to your work and there, but I wanted to talk about you organizing DjangoCon Europe, and how you you know how you did that and how you found that, and you know how you see DjangoCon Europe going forward? Oh, dangerous. Yeah. No, it has to be slightly spicy. Otherwise, no one listens.
Raphael Michel 10:00
Yes, so yeah, in 2017 at the DjangoCon Europe conference in Florence, my friend Tobias and I, we listened to the complaints that no one has signed up to the DjangoCon Europe the following year, the eternal complaints. Yeah, the internal complaint. And we, yeah, we put our hands up and submitted a proposal to do it in my hometown of Heidelberg, here in Germany, which we,
Carlton Gibson 10:33
which was wonderful, by the way, like such a lovely town, such a lovely venue, if you ever got the energy to organize it there again, I've definitely gone back. I love the philosophers walk the other side of the river.
Raphael Michel 10:45
Good cities to host DjangoCon European. And I think Europe has so many cities that fit the criteria that we don't need to repeat them yet. Maybe, yeah, not yet a few decades. But I don't, I don't think we need to repeat cities for DjangoCon Europe, but I think the perfect location for DjangoCon in Europe is like it needs to be big enough to host four and 500 people, have big hotel rooms and infrastructure and travel connections, everything, but it needs to be small enough to be walkable, to meet People again in the city after the conference, I like the feeling of going through a small town,going out to dinner with some folks, to a restaurant, and leaving the restaurant again, going to another place, and again meeting Django people. That doesn't work, like if we were doing it in London, or something like that. It's just at some time the city is too big. It doesn't work. It doesn't work in the way a lot. But I think finger can Europe works best.
Carlton Gibson 11:48
And so, yeah, I'm How did I was gonna say, How did you find the experience? How was the experience of organizing?
Raphael Michel 11:55
It was exhausting and also a lot of fun. It was, it was hard, because in the beginning you start trying to build a group of volunteers that work on it, but few people can properly estimate the amount of work this takes before and you get a lot of people signing up for it and then not following through. And in the end, one of the sad parts of DjangoCon Europe is that, in the end, in most years, it came down to 123, people carrying the bulk of the load. And that's, it's not a full time job, but it comes close and in some of the months.
Carlton Gibson 12:48
And, yeah, that's a lot to take on. Okay? And so six years later, like, you've obviously thought about this. And like, do you have ideas for the sustainability of Django. We've been, you know, we've been lucky that we carried on, and the Porto team were great. We kept it going over the pandemic period and but it seems like every year there's this same, you know, you said in 2017 the problem was no one had stood for well, it sort of feels like that's a familiar story is, how do we how do we make it sustainable?
Raphael Michel 13:23
Interestingly, we've had more proposals to host it recently. Don't think it's something I can go into too much detail about at the moment, but it it continues to be a problem, and it's a very hard problem to solve, because we want the conference to travel around Europe, and we want new people to come in and do something creative with that. Change change it a little bit. Make it better, hopefully, and for example, a large part of doing it for the first time that makes it hard setting up the legal structure to to host it? You need an association or a company. Somebody needs to be responsible, and I don't know if the if it ever goes wrong, someone needs to go bankrupt, probably. So usually that shouldn't be a person. It has been a person before, but it should be a company or an association that you can have dedicated for this. And depending on the country, this is quite a lot of effort to set up, especially if you haven't done it before. It takes time. It takes effort, and it's one of the thing that makes it hard to carry a lot of these. Like it's not an interesting part of hosting the conference, like assembling the program, doing social doing social events, but it's the fun part. But setting up a company or an association is not the fun part of organizing a conference, but it's it's one that we need to do every year, because it's so complicated for, say, a Spanish company to host an event. In Sweden, legally that we, we, we basically need a new one every year because we want to switch countries. That's a problem that in the US with changlican us, and definitely it's same legal Association over and over again. And it would be amazing to, yeah, make this easier and have more continuity, continue with the people, with the money, with the processes. But even though the European Union, even though it would be even harder without the European Union, it's still pretty hard.
Carlton Gibson 15:32
So that that was my kind of question, is there not, does the EU not somehow, does the single market somehow, not somehow make that cross border thing work.
Raphael Michel 15:43
It's not impossible. Europe, Python is doing it. For example. Europe, Python is a Swedish society, and they are currently putting on their event in the Czech Republic. However, that also means, because they're they're physically holding the event in the Czech Republic. The Czech Republic has a right to the tax income, and so the Swedish Europe Python society needs to register as a tax citizen in the Czech Republic. Not so different from setting up a new company and your Python. Python has, I think, about 10 times the budget of general Europe at 10 times the budget, it becomes more feasible to just hire lawyers, accountants to deal with it, and it's still a lot of work for them. It's not just hiring anyone. They still struggle with it a lot so, and doing that at a much smaller budget makes the event more expensive for everyone to attend, right?
Carlton Gibson 16:44
Okay, because Euro Python's like 1000 people, right?
Raphael Michel 16:47
I actually have no idea how many attendees they have. It at least 1000 I believe. But yeah, they have,in any case, they have a larger budget for it.
Will Vincent 16:58
Yeah. I was just gonna say I recall all these conversations when I was on the on the board the Django Software Foundation, because, you know, the organizers want and need help, and there's always the idea of, well, maybe we can be under the banner of Euro Python, which maybe, but they're, they're also not This huge organization either, and that's too bad we haven't figured out a solution, because it's so much work just to do the fun stuff, let alone all the money side. And I recall, yeah, a lot of conversations around the DSF, trying to the US, DSF, trying to set up a European bank account, and all these kind of things that maybe we just need to ask europython more forcefully or something.
Raphael Michel 17:45
Yeah, I'm hopeful, yeah, it's not a new conversation, and I'm hopeful we will find a solution someday, and I'm thinking about it regularly, but I have smart family, but there are positive steps as well, right? There's a the Django the euro, DjangoCon Europe working group and that you're involved with right to give people more support. Yes, there's a working group and that yourself that tries to support new organizers and to collect information from past organizers, something that has been going on before as well, but now in a little bit more formalized way. But if you say you want to do it for 2027 for example, you can ask the support group any questions you might have about it, or if you can have access to past budgets or whatever that we can share with you to give you a little bit of a head start. And we also try to well, the support group is quite new and the current organizers are quite experienced, so it's not happening that much. But the idea is also to check in with the current organizers now and then and see if they actively check in and see if they need any help or any further information.
Carlton Gibson 19:00
And just one more thought before we move on. If people have got like a half inkling, they think, well, maybe I could do a DjangoCon your one year. They should reach out, right?
Raphael Michel 19:09
They should reach out. They should reach out either via email to the support group or add a DjangoCon or another event to someone who has done it before in person. That's sometimes the more the more effective way to get the information that you won't find in writing, and to get a little bit of feeling about how it works, on how to approach it.
Will Vincent 19:32
And I just saw so we're recording on November 12, and that this episode will come out a little bit later, but just yesterday, all the details around next year's DjangoCon in Dublin came out, including a date, which is April 23 to 27th so I'm very excited about having a date. And Dublin is a great place.
Raphael Michel 19:52
Another thing that has been now improved, finally, that we've also been talking about for 10 years is the planning. The period has gotten longer. So when we sign up in 2017 for 2018 we had, I think, 10 months left to plan it, which is not a lot of time to find a venue and just get everything set up. Now, the Django Software Foundation has already requested proposals for 2026 this year. The deadline has already closed, and so there is the attempt to make the planning period longer, and that will also make it less stressful. Hopefully, yeah, it feels like you've an awful lot to organizing a very if you try and do it in a short period of time. Well, we also have a new board, or we have four new board members that will be announced soon. And I'm, I'm very the quality of the candidates was amazing, and there's a lot of energy out there. So I know that having new and energetic and international board members will help with all this. So that's that's definitely something to look forward to. I also want to say, like we talk about how much work it is to organize these things, but you you get so much back, like, just like anything when you put yourself out there, right? I'm sure, just for you organizing the event you meet, and, you know, work in a volunteer capacity with people you wouldn't know before.
Will Vincent 21:16
And you know, I feel like you get a lot back, any Yeah, like we, like we do with this podcast. You know, we don't monetize it at all. But I feel like, just for myself, my happiness with Django and get, you know, reaching out to people like yourself. So same thing with organizing a conference. The best way to meet people and get involved is to, is to get involved.
Raphael Michel 21:35
Yeah, absolutely.
Will Vincent 21:36
So you're, there's, I want to ask, you're very entrepreneurial. You have this company, rami.io, and a couple products. What is the full suite of? Oh, sorry, I, you know, I almost don't know where to start. I mean, because you have a number of employees and products, I was gonna say Rafael, tell us about your work, because I know you do some stuff, and it's all in this area over here, but it's quite there's a lot going on. So maybe let's start how? How many employees do you? Do you work with now? Because I heard you mentioned 13, I think two years ago.
Raphael Michel 22:11
Yeah, we're a team of 21 right now.
Will Vincent 22:13
You're in charge of that. You're the main yes ring leader.
Raphael Michel 22:16
Yeah, that's quite a lot to do. We focus on we, it used to be a lot of stuff, but I was doing what we were trying really hard to focus currently. And basically our main product is pretix which is a ticketing solution for any place where you pay to get in, which involves the entire event industry, as well as parts of the leisure industries such as museums or swimming pools or yeah, whatever you wherever you pay to get in. This is our target group, and we try to provide a end to end solution with online sales and ticket access control and cash registers and so on. And the smaller product that we have, that started in the pandemic is venueless, which is a live event platform, kind of combines live streaming and video calling into into one tool and a few other things. To her world conferences online, which, yeah, is something that we that we come up with to to help our clients, mostly 2020, to 2022,do their conferences at all. And now we still have a number of clients that use it to do hybrid or still fully remote conferences.
Carlton Gibson 23:36
Yeah. Can I ask about the hybrid nature is that? Is that holding up? So, I mean, during the join the pandemic, obviously it was all online only, and then the first year back, there was a, you know, very much, a two stream type thing online tickets as well. But how's the hybrid thing holding up? Because it seemed like it was, it was a growth thing. It was a new feature that we should keep.
Raphael Michel 23:56
Yeah, but that's not what happened. So the larger part of the event industry has fully abandoned and went back to in person only. Personally, hybrid events are very hard to run properly, especially if you want to do some proper community management and involvement of the online audience as well. Like streaming to YouTube is simple, but probably making it a connecting experience out of hybrid event is really, really hard and takes a lot more work and cost than doing either one. We have a client. He runs a lot of conferences every year, and they decided, Okay, we're gonna do half of it virtual and half of it in person. But we're not going to touch hybrid. It's too hard, it's too too complex. We also, they also want to be able to select different kinds of content for the different types of audiences and so on. So we still have hy or we have hybrid conferences on the platform. It compare to total amounts of confidence that we work with, or that we know it's a very small number. Okay, interesting. So there's so many questions.
Will Vincent 25:09
Maybe one of the, you know, the high level question, is it, this is open source software, and yet you support a team of of 21 how do and I know you've given a talk that we're going to link to it Fauci on building a business around open source applications. But what is the, what is the short version of how you manage that? Right? Because that seems like the dream for a lot of people.
Raphael Michel 25:32
The short version is that most of our customers run events, and either they have no idea what open source means and how to run a Django Software on a server, or they know what it is, but they don't have the time to because they're running our main revenue stream is providing the solution and software as a service. We also do all of the other kinds that you can monetize open source software. We have proprietary add ons that you can purchase from us that are not open source. We we sell support services, but really, 90% of our revenue comes from software as a service, because people just don't want to deal with running the software themselves, and it makes sense. It's kind of mission critical for a lot of them, like, if you if you're an event business, selling tickets is your revenue stream, and on the day of the event, scanning the tickets and printing badges is very important part of your of your user journey. And you don't want to deal with a silver outage yourself in that situation.
Will Vincent 26:43
Yeah, right. So when I look at the Git history for the project, I see january 2015 and I think is the first public commits. What I guess the question is, when did you 2014 already?
Raphael Michel 26:59
Otherwise we would have hosted our birthday party the wrong date.
Will Vincent 27:05
Well, maybe, maybe I'm doing my searching correctly, but I guess the question is, around 10 years now? Yeah, so what's the story of that? Right? I mean, because it's, it was you right, like you, you had this inkling, and you put a lot of work into this, into this product, yeah, not knowing that you'd be where you are now.
Raphael Michel 27:27
DjangoCon Europe is not the first community conference that I co organized. I started to get involved with a local conference. It's called Mr. MCD. It's low from the local, let's say, privacy and open source community. And somehow I raised my hand at the question of who, who's going to deal with ticketing money? And so I fell into that hole, and there is not a lot of open source software to deal with such things out there. And we tried one or two, and it was all bad. And so I decided I'm going to start my own, and I consciously because in that community, there's a lot of homegrown software that someone maintains for two or three years, and then it's no longer around and nobody cares about the software anymore. So it was a conscious decision to try to do it in a way that allows me to make it sustainable. It was never the plan to build a company with 20 employees out of but it was the plan to somehow monetize it to keep it alive.
Carlton Gibson 28:44
Can I ask? Because you start something new, and you look at what's out there, and you think, none of these are any good, but they've all got more features than like, you realize that you have to build when you start right like, you think, oh, you know, I could get this build up quite quickly. But then you realize, oh, it sends emails, and it's got this, and it's got that. And how, how long did it take before you it started to mature? So you start to think, oh, actually, it's it, you know, obviously there's always more you can build noise, things you can make better.
Raphael Michel 29:09
Yeah, absolutely, we're not done yet, right? But how long? So first commit, I think end of 2014 I was running my own conference. So the one that triggered the creation on it June 2015 so eight months later, and I think the first event that was not run by me with a lot of patching on the job, was a year later, early 2016 when we launched 18 months or I launched the soft Software as a Service version, I think, January 2017 so full two and a half years after the idea for ticketing in the United States.
Will Vincent 29:55
Anyways, we have this company, Ticketmaster, which is, I'll go and say is pretty much evil. And not only are they expensive, but they're also they don't work all the time, because so I know that you know, when you have challenges of these big spikes of traffic, right, where, nothing, nothing, nothing,how, how did you originally tackle that? And I'm sure that's a huge issue now, right, when you have very irregular streams of usage.
Raphael Michel 30:22
Yeah, absolutely. So that's one of the hard engineering challenges in ticketing, and it's not one we solved either. I believe it would be quite feasible to build the ticketing system that scales almost infinitely, if you would constrain yourself to a very small feature set and a very specific use case, but that's not what we do. We have a very extensive product with a lot of complexity. Think about and a lot of the problem is that you don't only have these these large load spikes, but you also have to deal with scarcity all the time. So for example, if you have a theater ticketing where you can choose your seat, there is only one seat, five in the first row. I can't go infinitely concurrent and run the system on millions of servers that are independent on each other, because I can only sell this seat once. Sorry, I need to actively prevent concurrency in a way.
Carlton Gibson 31:26
So, yeah, well, I was going to ask, so do you Okay? So do you take a kind of command, query type approach, where you like you request the request made to the Django request isn't a buy ticket. It's a request to buy a ticket and wait for a response, yes.
Raphael Michel 31:45
So all ticket buying requests go through a Celery queue in pretax. So it's just, it's a task that can be retried and can wait on a queue. And we use, we use PostgreSQL advisory locks now to have a very lightweight way of saying, okay, place a lock on this seat, on that quota, on this voucher, on all the kinds of things we lock so we can, but still, this locking limits us in how many tickets we can we can sell at a time, because, in principle, we can only sell one at a time of the same type if we need to take care of such conditions. So we're limited at around 1000 sales per minute, or something like that for a given event, because that's just how fast we can. We can get it right now and the the industry startup solution, but not very different to what Ticketmaster and others are doing, is like, if you, if you go beyond that, you have kind of virtual waiting room where you say.
Carlton Gibson 33:04
Okay, this website is on too much load. Please stand in line and we'll let you in soon. Okay, so, I mean,I've seen you give a couple of good talks at djangocons. I mean, not because good talks, great talk. So one on scaling channels in Edinburgh, which I just thought was the best channels talk I've ever seen. So I do recommend that, and then that batch, to be fair, but the other one this year was about the debugging slow, slow database requests in production, because that's the key, right? It all working fine locally, but then, but they're not when you get it out there live.
Raphael Michel 33:42
Yeah, absolutely. Just, just the other week, we had a slow SQL query that was, yeah, only debuggable in production. I think we, we found a post SQL backup. I'm not too sure yet.
Will Vincent 33:56
Can I ask a more detailed question, which is, so with your team, how do you, you know? How do you all set up your local machines? Are using Docker? Or how do you, you know, all work on the same thing.
Raphael Michel 34:07
Say, most of us quite old school with virtual environments and financial pi runs over. So for pre ticks, it's really, really quite simple for venueless, because it's a few more components, we have a Docker compose set up.But, yeah, my local pretext development is just a virtual and with a package installed. I mean, the great advantage Gordon, the great advantage of the VM or the Docker system is supposedly it's the same in every environment. Do you find? Do you find there's these cases where running locally doesn't, don't forget, like we we're not doing exclusively software service. We also have clients and open source users out there running our software on different machines, so having a little bit of chaos in the development around as well. But. Might even be helpful in everything that's that's very true. We actually like I develop most of the time. I develop on SQLite and we run on PostgreSQL and production. Wow, it has some challenges, but, yeah, it helps to keep some flexible, flexibility and surface.
Will Vincent 35:24
So then you must be using quite large fixtures to populate your local databases. Is that? Is that? How are you doing it? How are you working on the same stuff in the team?
Raphael Michel 35:37
No, no.
Will Vincent 35:41
How do you do it?
Raphael Michel 35:44
A colleague now set something up, a pretty steam roller plugin where you can, like, define the system settings in the YAML file, and then a small tool applies it through the API. But a lot of it is just run it locally and click through the different cases here. Okay, I know you said API are using and you mentioned view earlier, are using a view front end and API back end. Is it all service rendered? No, it's mostly traditional Django forms and views, we use view so we have an extensive API that we use, both internally and externally, but we and we have a few parts of the user interface that are view based, for example, the seating choice element or some other stuff. We have some some more complex using the face parts, where we where we use Vue and to build a more interactive component. But the major part is plain how Django was invented.
Will Vincent 37:00
And are you using Django rest framework for the APIs?
Raphael Michel 37:03
Yes, yeah.
Will Vincent 37:04
So you've resisted leaping over to Django ninja and some of the newer sizzle things.
Raphael Michel 37:11
I am quite resistant against hopping over to the new shiny thing when the old thing still works and I have 1000s of lines of code with it. Yeah, it's, it's one of the challenges. Now, after 10 years, some things are not that easy to change, but that's not true, right?
Will Vincent 37:34
Yeah, I was talking to Carlton earlier. I'm finally updating my I have a book on Django for APIs with Django rest framework, and Django rest frameworks in an odd place, and that it's feature complete, and yet, so it doesn't, it's not the shiny object, and yet, it's used everywhere. And actually, Carlton, that's that's to you, you helped with the 3.15 rollout, right? Like, what is, are you still officially a maintainer of,
Carlton Gibson 38:01
I'm still on the on the team there, but not really doing very much. I don't, you know if I'm pinged on an issue, I'll,you know, I'll comment or join in, but it's the thing is, it all works, right? Okay, so let's look at going the rest framework folder, and we look in the generics, yet they're all 100% battle tested. And look in the views, they're all battle tested. Look in the serializers, they're all battle tested. And the trick, the bit that people want changes for, they want tweaks for, is in the serializers, because there's a weird behavior, if you've got a null field here, combined with that, does it serialize exactly how you would want? Maybe it doesn't. But at this stage in rest framework life, that bug is almost bug. If it's a bug, it's it's almost unfixable because people are relying on the current behavior. And so you can't suddenly make it return true rather than null or none in that case, because that would break people's APIs in production. And so those small, those really small kind of just character bugs. They can't they almost can't be addressed now, so what's the solution? I don't know. I don't know, but rest framework is as reliable as it's been for the last decade. It's just not going anywhere forwards, like that's the there aren't going to be massive changes to it. Now, it's all which is good for your book, though, will right? Because, you know, you can update it more recently.
Raphael Michel 39:25
Yeah, no. I mean, for a project like ours as well, like, why would I want a new major version that breaks a lot of stuff if I don't have a lot of requirements, but it doesn't fulfill? Well, that's the other thing. Is, what would, what would be the major feature changes that would justify a breaking change in rest framework at this point, and there aren't any.
Will Vincent 39:47
Well, so I have to ask Rafael htmx, right? I'm sure you've had discussions around this where, where do you and your team sit on switching some of the view things over to htmx?
Raphael Michel 40:00
Must have been, I have, I have obviously heard about it and seen it then briefly looked at it. We haven't really tested it in the project. I don't have a strongly formed opinion on it yet. Okay, fair enough. I mean, it does, and you're in a different situation with a very tested product team. It does seem The advantage is, if you're a one or two person team, you can get a lot of the reactive behavior without having to split things up and do front end, back end. It's interesting that there's, now, I there's, there was a post, right? There was a post about too much HTML, I think that that got a bunch of traffic, you know, because it's not, obviously it's not perfect, right? So people are finding the the box in which it seems to work best, right? Where solo developer, great. But then there are the, of course, these limitations, just like there is with any tool, yeah, absolutely. And there is, like, I studied physics at university, and physics is a lot about loss, about conservation, conservation of energy, conservation of momentum, but there's also conservation of complexity. And if you're trying to build a complex thing, you're gonna have the complexity on some layer, and you can, like, in different situations, and can be a little bit better of having more on a different layer. But it's not going anywhere, yeah, and it's, it's kind of like you can shift it around one place or the other.
Carlton Gibson 41:33
But you said before about Django fitting your the way you think and view fitting the way you think that that's kind of the way I describe HTML, for me is that the reason why I like it is because it fits the way I think, and it fits the Django way I think, and so it's, you're exactly right. It's not about reducing complexity. It's just about going along with the way your mind works or not. You know, if you do go along with the way mind your works, it's, for some sense easier for a while. All right, so I want to, I want to ask you sorry, then you can go Carlton,
Will Vincent 42:06
So managing a team of 21 people and a very popular product, I guess, was that something you expected when you were starting out as a programmer. Were you thinking, I want, you wanted to be a business, Owner,
Raphael Michel 42:20
no,
Will Vincent 42:23
But you're still you're still happy. You're still doing it right, because sometimes people don't want to do that.
Raphael Michel 42:28
So what I what I love about it is that I have to deal with entirely new challenges every six months. Soapproximately everything six months, I'm learning something entirely new, but I've never done before, and I need to do it now, and I need to understand it, and that is very exciting to me. So far, it's a lot of fun. Of course, the things that I do day by day have changed a lot. I still spend a lot of time coding, but I also spend a lot of time in meetings, internally, with clients, with suppliers, with partners and stuff.
Carlton Gibson 43:12
Do you have to defend your coding time? Do you have to, like, insist on?
Raphael Michel 43:18
Yeah, absolutely. It's not so hard to find time for fixing bugs and other smallish urgent things, because they appear to be urgent and time appears, but it becomes quite hard to find time to work on larger features or larger projects. Luckily, I now have other very capable team members to do that as well. But I still enjoy it, and I'm also, I believe I'm still useful when doing it.
Carlton Gibson 43:49
Okay, on the running a business front, it must be, well, is it deeply rewarding to think that, you know, giving solid employment to 20 people, 21 people that like, and, you know, that's, that's quite a nice thing to put out into the world.
Raphael Michel 44:04
Now, I like two things, so it's also a lot of work, and also some challenges. And not without, like, Yeah, but yeah, it's, it's a nice result to get from, from just starting an open source.
Carlton Gibson 44:20
So you said, a while back, you said that 10 years in, it starts to get harder to make these changes. How do you cut How do you sort of try to manage that long term tendency to you know? Because if you know, if you don't manage it, you grind to a halt eventually. How do you manage to keep momentum?
Raphael Michel 44:37
So we try to stay very up to date with a lot of the dependencies that we have. However, that means, like, we're not going to bother with Django releases that are not on LTS. It's just too much work, not, not worth it. So we're we're upgrading 3.2 14, 2.2 and we will next be upgrading 5.2 We have the additional challenge that Pretix has this plug in architecture where you can install additional functionality as a plugin. So when we do a major upgrade, like a Django upgrade, we need to do that in around 120 repositories at the same time, which is trivial for some changes like replacing you get text with get text in the imports, and absolutely not trivial with a few other changes like delete form a delete view suddenly working differently. Yeah, so I remember, I remember that I thought, yeah, that's fine. That's fine. No one's but there's a few things but we, we haven't figured out yet. We, for example, our our HTML and CSS is based on Bootstrap three. And I'm not sure we will. We will never, I'm pretty sure we will never upgrade from Bootstrap three. We will migrate to something custom built, but tries to give a backwards compatible journey, because the effort of migrating 5000 templates to bootstrap five, just to do that again for bootstrap seconds, it's not going to work. So with a few things, yeah, we'll need to to find our own solutions for that.
Will Vincent 46:27
Okay, so my last big question is, I want to ask about stripe and billing, because I think you've been using Stripe from the beginning, at least since, at least since 2016 maybe earlier.
Raphael Michel 46:37
It's, yeah, it's one of the, I think today, 25 table providers we integrate with, and it's been the first that we that we've integrated together with PayPal, I believe. So that's on a very small project of mine. I was just integrating stripe, and I've done such integrations over the last seven or eight years, and Stripe changes all the time with how they do things, and I can't even imagine all the payment providers you've got to deal with.
Will Vincent 47:08
So I guess the question is, how, how do you manage that right? Because dealing with money is important to a business, and you don't want to get it wrong, and yet,
Raphael Michel 47:17
It seems like so much to juggle. That brings me to a feature that I would would love to have good support for Django rest framework, because what's really amazing is how stripe deals with API versioning. I believe, I think they have, they have found the sweet spot for how to version an API when they do breaking changes because you like, basically you can, you can set a request header that specifies the API version you are aware of, and it will emulate the behavior of the past API as long as absolutely possible. So Stripe is changing a lot, but actually we there have been a few larger changes over 10 years, but most of the time the changes are don't require a lot of action. On our end, we also only use the payments part of Stripe. We don't use the ability billing or invoices products, because these are all things that we have in our product as well. We have our own invoicing module and so on.I'm not quite sure anymore what the question was, but yeah, so most of the payment providers are not that hard to maintain, because they don't change that much, but they need to work well, of course, because people are are interested in getting their payment, yeah, they seem to care about that. I don't know why.
Will Vincent 48:49
One more, one more, small question. So to store money, integer field, decimal fields, positive, big integer field, how do you like?
Raphael Michel 49:00
Okay, yeah, so we we use decimal field consistently. Okay, works in the arithmetics with decimal field are what you want for money, unless you're on SQLite, but we don't use that in production. Decimal like SQLite, doesn't have a decimal field. It totally stores it, I believe, as a string, and then there's weird things with it when you try to do computation on it, but on post SQL, I believe decimal field is a good fit, except that we will not be able to properly invoice in about seven of the currencies in the world, because there we have money stored decimal field with two decimal places, and there are, I think, seven currencies in the mobile have three decimal places, mostly in the Arabic countries. And I'm not sure if we're ever going to be able to. Properly migrate those fields. We had the problem already, like we had a 10 digits of two decimal ticket that should be already needed to migrate to larger decimal field because, and don't remember which, which currency, voice and currency where we have these very large amounts, where it like would buy confidence tickets for a few million. But in the end, these differences are why I feel, why I'm quite happy with using decimal field, because if you're storing it in so floating point is wrong, we can get that out of the way. Floating is floating point numbers is wrong, storing it as integers, brings you to the same problem, because in American projects, it's usually integer of sense. But now you look at the Danish Corona, which doesn't have a decimal part of the Japanese yen or or you look at the Jordanian dinar, which is three decimal places, and now either you would need to globally multiply by 1000 even though that gives you integer representations of things that don't exist in US dollar, or you would need to have different multiplicators for different currencies, which sounds even worse. So the complexity there with the initialization is the same, whether you're starting it in decimal fields or integers. There are a few advantages or digital advantages to either one.
Will Vincent 51:31
Well, I'm about to launch something, so maybe I'll switch to decimal field because I have been using integer.
Raphael Michel 51:36
But So the really, really bad thing is that a lot of the payment providers, like PayPal or stripe, they specify in their API, please submit the amount in integers of the smallest denomination of the currency. Yes, yeah. And there are some currencies like, I think the Danish Corona technically has a decimal point with two places bounded, but it hasn't been used in decades. So, and they don't publish whether they consider if the currency with decimal places or not. So depending on the payment, provide you might need to multiply it with 100 or not. So whatever you do, document very clearly how you want other currencies to be handled? Yeah. Well, it seems like it's like time zones. It sounds like, oh, money is money, but just like, time is not time zones are not time zones. It's quite complex. We store the time of an event as a Django date time, but it's time zone aware. But technically, that's wrong. We should be storing local time on a place, because if the time show time zone legislation changes before the because we're dealing with events in the future like DjangoCon 2025, is going to be in Dublin, Ireland could abolish daylight saving time before it happens, and then all the timestamps in our database would be wrong, and we will need to, like, manually fix them for all the events that are taking place in Ireland. So far, that hasn't happened, but, yeah, there's so much hidden complexity here.
Carlton Gibson 53:18
Good the other day as well. Your i18n came up, which is a solution for storing multiple languages of multiple text translations in a single field, right?
Raphael Michel 53:28
Yeah, so we, there's quite a few things in critics where we are doing things, maybe a little bit unconventionally, and published our package. One of them is the how we store a translatable string. So if you are hosting a multilingual event, you can also give the event a name in each language and set up email templates every language we have a custom field type that allows doing so that is Django I 18 and field. There's also Django scopes, which is our way of separating multiple tenants in the same in the same Django project, in the same database. My given a talk about that, DjangoCon Europe, 2019 and Copenhagen. I believe, or no, 2020 online. I believe it's it's on YouTube. And we also, like, we have our custom package. It's called Django hierarchy, but it's our setting store. Like, we have over 1000 settings that you can use to configure your ticket store or shop, and we don't want to do model migration every every time we add one. And it's also like with the plugins and so on. So we have this, this in database, key value store that has a hierarchical, hierarchical dependency, because you can set things on the tenant level, on the event level, and even on the global level, and it kind of trickles down. You can, you can inherit the settings from an upper. I also there's a number of of small Django packages that we maintain because, yeah, it's useful for us and maybe for for someone else as well. But like you, you'd said that they you did it in an unconventional way, but these are kind of battle tested ways. They grown out of your actual needs, right? And so, you know, you might done the IT and M field. You might not want to store the repeated blobs in the same field, but, well, actually, that works for you, and it's simpler for fetching it's simpler for various others.
Will Vincent 55:33
Yeah, absolutely. Well, we're, we're getting a little bit close on time. Is there anything you know, we haven't asked you or that you wanted to oh, well, bring attention to
Raphael Michel 55:42
No, I don't think so. Prepare for the question.
Will Vincent 55:45
Well, that's our fault. I mean, normally we would ask something around, what would you change in Django? But I think Carlton led off with that early on. So you know the magic wand, right? What would you what would you change? Is there anything else that comes to mind in core Django that you'd like to just make so so for rest framework as mentioned, API versioning that is really helpful for on both ends in core Django.
Raphael Michel 56:15
Yeah, I think what we talked about before, I think we need build in batteries for two factor authentication. It shouldn't be something you add I describe, not so sure about single sign on Open ID, connect someone's own because that's very complex, and that's very that's also changing landscape, but I think we really need, like, if I, if I install Django and set up a Django admin two factor authentication should be the default, should be fully, fully integrated, yeah.
Carlton Gibson 56:53
And there's no reason why Django couldn't ship some kind of adapter layer, like, you know, like Django could define the the interface that, if you implement that, then you, you know that could, you could add your or throw for, I don't know, log in by whatever. Yeah, all right.
Will Vincent 57:10
Well, I feel like we could ask you questions for another couple hours, but that's a really, it's a really impressive thing that you've built. I would say, you know, open source project organizer, team of 21 and maybe most impressive is finding the time to still code yourself. I think maybe that's part of why you seem to enjoy it, right? Sometimes people have monetary success, but if they get moved away from the engineering or core work that they really enjoy, I've seen people who don't really enjoy the success of their companies when they're in meetings all day long. And, yeah, it's understandable.
Raphael Michel 57:47
Yeah, so far, it's for me, great.
Will Vincent 57:52
Well, we'll have links to everything, especially your talks, which Your talks are fantastic on all these topics we've mentioned, and hopefully I'll get to see you in DjangoCon Europe next year. Are you planning to attend in Dublin?
Raphael Michel 58:05
I'm not so sure yet, but okay, the year after, definitely.
Will Vincent 58:11
Okay. Well, it's fingers crossed for those. Fingers crossed. So we are at Django chat.com, and we'll see everyone next time bye, bye, bye.