← Back to Show Notes

Transcript: Django Security - Markus Holtermann

Carlton Gibson

Hi, and welcome to another episode of Django Chat, a weekly podcast on the Django web framework.

I'm Carlton Gibson, joined as ever by Will Vincent.

Hello, Will.

Hi, Carlton.

Carlton Gibson

And to g I Will.

And to with us this week, we've got Marcus Haldeman, who's um a member of the Django Technical Board and on the Django security team, and you know, is on the Django ops team.

He's just a a stalwart of the community.

Hello, Marcus.

Markus Holtermann

Hi, Carlton.

Hi Will.

Hi, everybody.

Carlton Gibson

Hello, thanks for coming on, Marcus.

So I guess look, let's kick off.

How did you get into program?

How did you find Django?

You know, how long have you been with the community?

These kind of, you know.

Markus Holtermann

Uh I've been writing code for oh two decades now?

I'm not even sure.

It's been it's been quite a while.

Um and then got into Django um 2010-ish.

Um as part of the German Ubuntu users.e community.

That's a Django project that's started even before the days of Django 1.0 or something.

It's like 9 0.90 or something.

Like the very, very early stages of Django is when that project was started.

And it's a support forum for the German-speaking uh Ubuntu community.

And yeah, features a bulletin board and news articles and planet and all these kinds of things.

Is that still going?

Markus Holtermann

It's still going.

It's still maintained by a few folks on all it's not unfortunately not open source.

It's uh kind of a thing that we since ever ta uh talk about.

Yes, we want to make this open source.

But because it has so much legacy, it's also one of the things where there's a lot of cra uh technical depth in there that we wanna or that that the folks who work on it these days wanna get out of it before they actually open source it.

Will Vincent

Were you gonna say craft?

Is that the word that was coming to mind?

Yeah, probably.

Markus Holtermann

Um I guess it's before

Will Vincent

Maybe that's the kinder of the words that start with CR.

Yeah.

Markus Holtermann

Yes, exactly.

Carlton Gibson

But that's uh that's that's just any old code base, right?

Any old like so that's that's what um 10 years old, 15 years old, coming, you know, that's an old code base.

Markus Holtermann

It's I think that they started writing that and I wasn't on the original team, but it's they started writing that in 2006, I believe, I believe.

And it's it's one of the pro uh it's a project where then as a side effect, like worked so like Flask, Ginger2, all those uh projects came out of um yeah, it's uh it's kind of in the well not early stages of the Python web part, but I guess the Django-ish style uh web development part.

Carlton Gibson

Yeah, that's kind of cool.

And that got you into Django.

Markus Holtermann

And that eventually got me into Django, and uh yeah, there's um Apollo 13 is on that team as well.

Or was back in the day was on that team as well, and then he eventually kind of like always pushed me a bit to maybe contribute to Django because at that point he was a core contributor as well.

And yeah, that eventually got me into uh contributing to Django after Andrew Godwin merged his migration badge in 2004.

14, I believe.

13, 14, 14?

Carlton Gibson

Well 1.7, right?

Markus Holtermann

1.7, exactly.

And yeah, then uh I contributed bug fixes there every other day or something.

Carlton Gibson

Yeah, because you'll wanna because you're like so when the tickets come in on the migrations, I always wince a little bit because they're like they're they're quite hard and I'm always quite glad if Marcus comments or you know, a couple of other people.

Marcus is one of my core, you know, peop go-to people on the migrations framework.

Markus Holtermann

Uh yeah, maybe still.

I unfortunately hadn't didn't have the time for the last few years to actually do a lot of things on the migration framework.

Um But I think I it seems there's a bunch of other contributors these days that actually have picked up behind me and behind Andrew and others that contributed on a regular basis and like squash out all these bucks these days.

Carlton Gibson

Yeah.

So so you please go on, Will.

Will Vincent

I was gonna say I'm gonna put a link to all the various teams on the Django project um site because I think you have the record for being on like all of them, right?

So there's and again, and this is also in flux.

You're on the ops team, you're I guess you're not technically a releaser, you're on the security team, you're on the technical board, though not the advisory board.

So I guess you're and then you're on the technical team, so you're missing two, but all the other boards.

And then that all is in kind of flux because now there's the new technical.

So perhaps um what is the future gonna look like in terms of the organization, right?

Because like the term Django core even is tossed around.

What do you make of all this for a casual listener?

So how should they understand?

Markus Holtermann

So about a month ago or something, beginning first quarter, uh first half of March or something, um, we passed um the Django enhancement uh proposal number 10, which essentially uh states that we want to change how Django is being developed or how the Django community works and and how decisions are made, and who has well I don't want to say the right to do something, but who has

who can eventually if if there's a discussion that doesn't come to a solution or where where people can't agree on one of the uh two one of two things, um who can make the eventual or final decision to go like okay, let's go with this way, or or another one.

And um yeah, I g I guess that's that's one of the things that's that's been one of the things that's been around and where we've been trying to do that for quite a while, but never really got around that.

Now James Bennett finally managed to actually write down this debt and the well at that point the Django core team um voted on that and it was accepted with quite a large number of um of votes.

And yeah, so then the future of the Django project is gonna look different.

Look I guess.

Um we're trying to open up the decision-making processes and make those more visible.

Will Vincent

Um yeah, because the because the other piece was the uh so DEP 10 and then uh the core voted on it, and then the the Django Software Foundation board, which I'm on, most recent meeting, we approved it.

So going forward, I think the idea is that there'll be the technical board and then the the one I'm on, which is sort of the non-technical things as kind of the arbiters of disputes or decisions that arise.

Because the next step is an election.

The um they have that um Frank Wiles, who's the president, is gonna be configuring, uh setting up the election of technical board members.

Markus Holtermann

Yes.

Um frankly, I'm not entirely sure about the exact process of big of from the uh from the top of my head because it's a fairly lengthy document.

But yeah, we need to Yeah,

Will Vincent

well, I I mean I'm I'm privy to uh it is a long document, um, and James has has spent a ton of work on it.

Basically, the reason why uh Frank is gonna take that on is because we don't want someone on the technical board to be in charge of the forum for voting, but it's just gonna be a Google form with the proper permissions.

Markus Holtermann

Yeah.

Seems like a that will be probably a good idea.

Happening.

Will Vincent

So but I think part of part of that is as you were saying, is public versus private discussion, right?

Because that's sort of a big thing about so w what are some examples of why that matters for the Django community?

Markus Holtermann

I think it's just it's Django is an open source project and we should be able to make decisions in a public forum and and make it visible to anybody who wants to contribute to understand the reasoning of how the people who made a decision came to that decision.

And seems to be just in the nature of how to do those things.

And that that making those decisions in public seems to be the right choice.

Will Vincent

I think the other part as well is that the term Django Core is something that you get and you never lose even if you're not as active.

I mean, because for example, you're incredibly active and there are members who have the title who are not as active.

So I believe one of the intents is to I think they're gonna that's gonna be a a legacy thing that can be bestowed, but but to have the technical team reflect the current active members as opposed to people who were maybe more active in the past.

Markus Holtermann

Well the the um the term Django Core or or rather Django commit or Django Core team member has been or is is a term for somebody who had been given commit access in the past and it was always kind of a you app once you have it you don't lose it unless you mess up like big time, but I don't think anybody ever did, or you hand it or give it up um by yourself.

Um but then these even yeah, if as you said, if you then don't actively participate in the whole development of that, then you still seem to be on this list of people who are in there and you can still take credit for for that position.

And sure, then you have contributed in the past a significant amount of work, and that was usually the thing that's kind of led somebody to become a core core member, then um it's using that position or using that title that you had in the past kind of made sense and um seems fine to me.

Um but over the last years it's been clear that this is not really like this big thing in Django that somebody could do to become a core committer or core member.

Um and the things that you in in the past indicated somebody becoming commit access are just not really there anymore.

So finding a way to become c a core committer wasn't just something that still existed.

So dropping this whole concept and acknowledging people who had be had this position in the past, but then essentially dropping this whole position um seemed kind of like a better or good way forward.

Will Vincent

When part of that is that because the term core was around before there were Django Fellows, because Tim Graham and now Carlton and Marius, in terms of releases at least, they do much of that work um for the community.

Yes, so so that's part of the Exactly.

Markus Holtermann

So in the past we um with commit access, you were able to commit to the GitHub direct uh repo repository directly.

And some people, a small number, I think like three of three people, um had release access, which meant they had the possibility to put packages in PyPI.

Um and with the with this with the new change of the DEP 10, this also changed in a way that you don't need to be or you yeah, the we we will have a merger role, which is the people who have commit access to the Django repository, and we have a releaser role, which are the people who have access to Pype I and can put packages on PyPI.

Um people can be in both, but they don't have to be.

Um so if you for example don't have the time to constantly review and or time to merge patches, um and and specifically review is not necessarily up to the mergers.

They should yeah, they should be doing like a send it uh like a check on style and and so on, and do a like general review under PR that it makes that whatever is committed or that whatever they commit makes sense.

But um the discussion if the approach is taken in a PR should be taken by the community and by people who are going to be involved in this in this change.

Carlton Gibson

Yeah, because you can imagine like you know, a number of people reviewing the PR, and then the merger is just the person who clicks the button at the end.

It's it's kind of the you know, I always describe the fellow role as like the janitors, by the way we speak before.

Um that's kind of what we do is we just you know just keep it tidy.

I mean we do do reviewing and all that.

Markus Holtermann

Yeah, I mean you do more than just being the janitor.

Um you do far more than just being the janitor in the for the Django project, but yeah, it seems to be a significant role to to what you're doing.

Will Vincent

Well, and I think part of this in general is the reason why that like for me on the on the board and you and the technical board, why we spend time on this is because it's an open source project, basically everyone's a volunteer, and we wanted the system to be in place so people can contribute, but not one person has access to everything, for example.

And so when people do leave, there's a process, as you said, for new people to come in to be a handoff of of knowledge and power.

I mean, even for example, so we added GitHub sponsors to uh to the Django repo, and that's something I worked a lot on.

So I have access to part of the Django repo, but I couldn't fill out the form, so I had to get Marius, who's the fellow, because he has you know more access.

So these layers of permission are important just in case you know you don't want it someone to have the keys to everything and you want to have a bit of structure, but not so much that it's prohibitive to get anything done.

Yeah, this is how I think about this as any.

Carlton Gibson

I mean, but things particularly with access to like PyPI, you know, that's that's sensitive, right?

You you can't you can't have a a package being uploaded as Django to PyPI if it isn't Django.

Yes there's too many people depend on it being Django for for that to happen.

Markus Holtermann

Exactly.

There's opening up the whole thing, um opening up the whole contribution process to Django and um allowing more or less arbitrary people to be to be voted on to be um mergers or releasers comes with a side note that we with a perspective and me taking this from a with a perspective of a more security console conscious person right now comes with

a the problem that we need to trust that person to not put in some like backdoor or whatever in that release package that somebody needs to inspect and and find.

And so yeah, it's the the the selection process or the vote voting process on who becomes them will be open according to the things that are stated in the depth.

Um but it's definitely gonna also gonna be something where the community needs to look out for that not some random malicious person is going to like hijack Django because that's not gonna be a good uh

Carlton Gibson

But I was I was reading the the depth the j yesterday or day before, some for some reason I needed to refresh my memory on it.

But um the the the the qualification to be on so the technical board have to um uh okay the nomination of mergers and releasers for these important roles.

But to be a candidate for the technical board, so the technical board will be elected by the DSF members.

So already to be in the DSF, you have to be known by the community, right?

Anyone can join, but you have to be known by the community.

Well you can

Will Vincent

s you have to you have to be nominated and then approved by the by the

Carlton Gibson

candidate for the

Will Vincent

I think you can self-nominate, but there's and actually I'm linking.

I wrote a blog post just recently about what the board actually does.

There's I think 180 or so individual members.

So sorry, continue Carlton, but that's like the first step of Yeah.

Carlton Gibson

So but like the to be a tech so but not anyone can be on the technical board.

You have to have a shown uh like a a recent, like within the last couple of years, a shown um history of contributing and reviewing PRs or working on track or the or the you know GitHub or being being in the group.

So to be a candidate for the technical board is actually quite tough.

It's it's not like any any person who isn't known to the community and known to be a contributor could could even stand for the technical board.

I think so.

I think that the term the wording in the depth is is actually very um conscious of the deck of the possible dangers if it were more open.

So I'm quite relaxed about it in that sense.

Markus Holtermann

Yeah, it it definitely James definitely put a lot of thought into that part and and the other person people who contributed in the in the writing of the dep.

I mean James did a major part of that, but as again the discussion on the depth was uh held in public on the on the depth itself, on the PR.

Carlton Gibson

And it was over a year in discussion, right?

It was it took a long time.

I don't even know.

Markus Holtermann

It's taking quite a while.

But that's cool.

Will Vincent

So maybe we can talk about some of these hats that you wear, because I I hope that there's more of an understanding of the you know the many, many roles that you you play in the community.

So let's pick security team.

So you and Carlton are both in a security team, and I think what's the process for a normal security release?

And then there was that the uh GitHub SQL injection injection one recently, which I believe you did the commit for that you you all turned around in two days, a month or two ago.

Markus Holtermann

Um right.

So the

Will Vincent

It was first discovered on GitHub.

So what's the normal process?

And then I thought that that that one was particularly impressive, where maybe it was three days, but the it was discovered, the commit was done and it was released.

Yeah.

And so the

Will Vincent

usual I thought that was cool.

Markus Holtermann

Thank you.

Um the usual process for security thing is usually that well, somebody reports either on Hacker One on a security mailing list or security reporting list, um, security at Django Project.com.

Um reports a security issue or a suspected security issue.

Like rather be conscious and like think this might be an issue reported, and then we go, like, actually that's not, but that's we we much rather have that than somebody just putting something open in into the open and like oh shit, this is something that we should have like fix now.

Um, so you usually report something in a private way, and then people on the security team are going to review that.

Um, is it an issue?

Is it's like do we need to fix it like now now, or do we have time till to rethink the whole approach we have there?

Um we then usually talk to the reporter and and try to figure out who's going to write the patch who's going to review the patch like we try we we love for reporters to also contribute a patch and then uh the people on the security team reviewing it but if they feel like yeah now it's I don't really feel like writing the patch then somebody on the team is going to write the patch and we then hand out the patch the or the proposed patch to the reporter and ask them to app

ly that and see that this actually fixes their bug in their well probably production environment that they have there.

This maybe goes a bit back and forth once we are done with that we um pre-notify a set of organizations companies um of an upcoming security list uh security release um we also pre-notify the on the Django announce meeting list that there will be a security release on a with a given date and time and then at that point well usually Carlton on it or or or Marius are going to well

commit the patches to the Django repository and issue the corresponding releases and announce at the release.

Carlton Gibson

Now that's

Markus Holtermann

yeah go ahead.

Carlton Gibson

Go I was just going to say about that that commits because it it's like um potentially sensitive and on that morning of the release and so we've got a time and it's like we've got the patches ready and they say we're gonna have to you know we're just we just dropped 1.11 for um from extended support but the time we were supporting Django 1.11 Django 2.2.0 and you have to merge those patches onto onto the branches and then within a short period get the release out and the announcement out because once you've merged them th

ose patches are public and so that it's kind of like you have to get all the pieces lined up and it's a little bit tense you know it's it's much harder than a normal release which you couldn't you know you take your time on.

Yeah carry on Mark as you were you were saying so we've

Markus Holtermann

Yeah there's this um I can definitely understand that yeah issuing a security release is a whole different story just from the mental uh capacity that's involved there.

Because you can't like a usual release you can go like oh yeah we broke whatever in there we're just gonna it just don't install the new version like pin something to before and then like take the time to to fix this bug and s or revert it and and issue another one.

But if that happens with a security release you go like oh damn well we just published a security issue which we don't have a working patch version for.

And you go like this is not ideal.

So the the other issue that you you brought up with the um with this with a GitHub uh SQL engine uh it wasn't I think it was like this

Carlton Gibson

was an account hijack.

It was an account potential account hijack.

Will Vincent

Right.

Yes yeah it was like the password reset yeah that's what it's um

Markus Holtermann

password reset yeah something like that um

Will Vincent

it was like a Unicode character or something too you could shove something in there.

Yes you guys actually worked on it.

I'm just sitting here like talking over you

did the work.

Carlton Gibson

The issue was that if you get a a domain with Unicode characters in which sort of lower case comparisons to you know with certain database backends to another domain.

So you know it could be google.com but the the the O's are funny Unicode characters and then it would look like it was a Google email but in fact it wasn't a Google email.

Markus Holtermann

Yeah in that case uh if like the issue itself is known then you don't really need to treat it as a sensitive or or private issue anymore because the moment where those security issues are known and possibly exploits are known um a bunch of smart people are going to look through all the code bases out there and trying to find projects that's or code bases that are vulnerable and at that point this time between announcement and pre-notification is just well

kind of wasted time because we should instead have that time people already fixing pe fixing their their installations.

Carlton Gibson

Yeah so normally we give seven days but you you can't give seven days when there's a exploit out in the wild

Markus Holtermann

so yeah it does in this c in this case we just dropped the pre-notification we s we we issued the release on May

Carlton Gibson

pre-notified by a day I think

Markus Holtermann

something like that.

Will Vincent

I was just gonna say for Carlton and I often beat the drum of keep your Django version up to date and even if you're using an LTS you should do the minor releases the security releases for this reason because otherwise you won't get yeah the security updates.

Carlton Gibson

Yes on the if you're if you're on a a version that's in extended support then it's definitely a you know if there's a point release you definitely want that.

Like yes data

Carlton Gibson

data loss or it's security you want that.

Markus Holtermann

Yeah absolutely

Will Vincent

let's go down the list.

Ops team so you and I have had some I I've been emailing around that maybe we don't need to discuss some of that but what does the ops team do?

Like what is the ops infrastructure of Django itself?

So you're on there along with uh Florian Tobias and um Carlton.

Markus Holtermann

Um well we have this website and you probably have heard of it Django Project.com and that needs to run somewhere and well we also have a um ci continuous integration that we use for testing Django which is um run on Django CI.com um and hands out when you run websites you need some servers or something in the back end that that does work um and yeah we use we kind

of maintain that the the software or the not the not necessarily the software there but the the infrastructure like we up keep Jenkins Jenkins up to date usually we uh when that when there's fixes to the Django website we deploy them um these kinds of things.

Will Vincent

Yeah well it it's it's I think another sort of unsung role in the broader community but quite a bit of work is done and so for me on the board what's as as the treasurer is what's what's relevant is there's some costs involved with that so I monitor and help pay those um rackspace has been sort of the major contributor the last few years who provides the servers um they've been very generous with that so just another one of these things that's happening in the background that makes Django happen and um you know you Marcus are very involved with so I

want to call that out.

Thank you.

Will Vincent

I have a long list of things that to ask you about but maybe let's talk about your day job right you work at crateio which is IoT scale database can you tell

Carlton Gibson

us what all that means yeah yeah yeah IoT scale database explain

Will Vincent

that that's not you that's that's the headline on the website yeah

Markus Holtermann

uh it's the headline on the website which is fine um so we we build a database for the IoT market um so IoT is usually time series time series database uh time series data so something numbers

usually or or maybe some l add a label to that and then a timestamp and um well you want to like aggregate data from usually or in in the fo the market we are focusing on is the industrial IoT.

So you have factories that companies have where they equip their production lines with sensors or the machines in themselves are already equipped for sensors and you want to do analytics on on those machines and you want to understand when something goes wrong.

And like this whole in order to do analytics you need to store the data somewhere that you and then aggregate things.

And turns out when you have a lot of plans or or manufacturing lines and and machines and a lot of data and a lot of numbers then you need to s have a database that can cope with that.

And yeah with CrateDB um we have a database that's uh based on Lucene um scales fairly well uh like pretty pretty much almost linearly for I don't know even know how many nodes um and can cope with ridiculous numbers of of records in in tables.

And yeah it's a SQL database after all so you still write your SQL statements and it returns your n the the records.

Will Vincent

So why not Postgres right?

Obviously there's a lot more that Postgres can't do which is why you work there and you have this product but what is where does if I start a Django project that's IoT and I'm using Postgres, where do I see that oh I need something better or bigger like create?

Like do you have a sense of where that friction comes up?

Markus Holtermann

So one of the things with Postgres is that it's transactional for example like I'm not even sure if you can run Postgres without transactions.

I suppose you can't.

I guess you can't.

Um, you probably also don't want to, that's it.

Um CreateDB on the other hand is um eventual consistent and you have kind of multi-master or you don't really have a masternode in the in your cluster, you have a an a single node that holds at a particular m set of time or at the current time holds an information about the whole cluster, but that's known is also known to everybody every other node.

But you can write to every other node in your cluster, connect to every one every node, write to every node, read from every node, and it's more or less self-balancing with the data if you don't screw up your table creation.

And you're the what is the advantage of that is that ingest speed, you can pull in the the rate at which you can ingest data is just order of magnitude higher.

Markus Holtermann

It's it's orders of magnitude higher.

I don't even rem know the exact numbers that we are currently looking at with some of our benchmarkings.

But it's sure you can scale your Postgres ridiculously uh high and and improve a whole bunch of inserts.

But at some point it's going to you're going to run into issues.

And then for the most part in create you just add two more nodes to your cluster.

The just in quotes, because it's like just in IT it's never going to be a you can simply again in quotes.

Um but it's

Will Vincent

that's like tutorials.

I always try to put simply, just simply install Jenkins.

Exactly.

It goes over well.

Markus Holtermann

Um but yeah, for the most part it's you add a note or two or five, and your cluster has more storage space, your cluster has more throughput um aggregation capabilities, memory, all these things.

Carlton Gibson

Um and so the the other question you said eventually consistency.

So sort of how long does that take?

Because I've used eventually eventually consistent data stores, and quite often that just means where's my data?

You do a write, and then you do a get to get it back, and it's like not found.

And you're like, hang on, I just inserted it and you said it worked.

Where is it?

Um So the I mean how long does that take to run through, say, if you're you know I mean I guess it depends on the size of your class or anything, but

Markus Holtermann

I s I think it's sub-milliseconds or a milliseconds area.

But like you're not gonna wait five minutes for this number to show up somewhere.

I mean if you're if your complete if your entire network is completely overloaded, for sure it's gonna take time, but then you may want to reconsider your network infrastructure.

Carlton Gibson

Um spin up that extra node you talked about.

Yeah.

No, so uh

Markus Holtermann

adding more nodes also means more communication.

Carlton Gibson

Right.

And you so the uh you said it was based on Lucene, which means it well, the thing that comes to mind is well, Elasticsearch.

How does it compare to Elasticsearch?

Because I know a lot of people use that for high-engest um um use cases.

Markus Holtermann

Yes, in the very early stages of Create B it was merely a plugin on top of Elasticsearch that provided the SQL interface, which over time became a well not a fork of Elastic, but like had a bunch of code from Elastic that was um used and then then we create uh we had our own stuff around that or meld it into the

whole thing and that made up Create TV at that point and then eventually um I think last year, I guess, I think we dropped the in or the core team there dropped the enti dropped Elastic in that sense that's um it's not in the code base anymore.

Um so it's it's I'm not involved in the direct development of the database itself.

Um so I can't actually tell you m that much about the details of the development there and the the specifics around the code.

Carlton Gibson

Um But are you aware of the sort of general like what was it that Elastic didn't scale in a particular way or do you know do you happen to know that?

Maybe you don't, I don't know.

It's just interesting.

Markus Holtermann

I'm not entirely sure, to be honest.

Carlton Gibson

Okay, fair enough.

Fair enough.

It was just uh, you know

Will Vincent

Well and you I think your your master's studies, you you did some work on Elasticsearch, right?

So that's back in 2014, along with Alex.

Uh no.

No?

Oh, whoops.

Will Vincent

Sorry.

I got the wrong I was looking up.

Ah, I pulled up wait, oh weird.

I'm sorry.

I was just quickly pulling up um wait, it's on your

Markus Holtermann

I my my master's

Will Vincent

with Alexander Griebert?

Because I I saw you had a talk on Elasticsearch and I was just trying to pull it up and it pulls up from 2014 you have a whole post on it.

Carlton Gibson

So I saw you I saw you give a very good talk in um on Elasticsearch.

Markus Holtermann

It was just one calls at uni um where we so through all my all my studies, I always with all the projects that I had to do, I always tried to use yet another technology just to like play around with it.

And went from C, C, Java, uh, eventually Python, um, to and then in in in the masters and that one calls in the this one uh one blog post you, I guess you're referring to with the school data in Berlin.

Um we figured, hey, how about we just build a static website and then throw all the data we have into Elastic and just query that straight from the front end.

Um but that's about it, what I did with Elastic there.

Um thing I think you carton referred to was a talk I gave

Carlton Gibson

on the Heidelberg in Heidelberg.

Markus Holtermann

Uh like to search.

No, what was it?

Carlton Gibson

Um let me summarize what I remember and you can correct

Will Vincent

copy correctly.

I mean I've got it here.

It's combining Django and Elasticsearch.

You have the slides.

Carlton Gibson

Um talk about how you can use the Django RM and write that and then how you would sync to Elasticsearch to do your information retrieval, your search queries.

And I remember it being so good because I at the time I was flirting with this idea that oh, we'll just drop the ORM loader.

If we're gonna sync everything to Elasticsearch and search from Elasticsearch, and even we're gonna serve the web pages perhaps from Elasticsearch, why not just write to Elasticsearch and not bother with the Django ORM at all?

And you were like, no, no, no, because you lose the transaction handling, you lose the ORM, you lose all these and you're exactly right.

And I was like, yeah, that's that's that's answered that question canonically for me.

Markus Holtermann

Um yeah, the talk I I I looked at the talk, it's um on the lookout for your data from DjangoCon Europe in Heidelberg.

You're right.

This 2018.

Carlton Gibson

But that's a great video, folks.

You must watch that on YouTube.

Yeah.

Link in the show notes.

Will Vincent

The um the other talk project that I wanted to that I was saw of yours recently was the the logging article where you uh you know you talk through Django and and logging at a really deep level, but then you just casually link to this GitLab repo that's amazing, where you have all these examples of how to structure your logs in different applications, which we'll we'll link to.

Like the you know, because I I put uh code open source sometimes, and you know, you got a lot of good stuff in here, right?

You have like an airline example, a bank example.

That's and you just sort of casually mention at the end, like, you know, I would just like make a video of that being like, check this out.

It's a lot of work to make that.

Markus Holtermann

Um it's been a top this this so the topic there in this talk is about structured logging.

And yeah, structured.

I could recite parts of the talk now, but then I'm not gonna do that.

I'll I suppose you can put the link to the talk somewhere in the description um or in the links.

Um I fear I'm gonna spoil the surprise of this talk.

But um

Will Vincent

Okay, well I just I'm the I actually have code to back it up, which was I which I always like.

Like it's not just talking, it's like you gave examples.

Markus Holtermann

Yeah, I d yes, the um the parts you mentioned there with airline and so on.

It's the reason for that is because of the title and the the whole story of how I try to bring this whole title of the talk into uh why you would want to do structured logging.

Um and with that refers to a movie.

Will Vincent

Okay.

We'll we'll put the link up for everyone so we won't ruin it.

Will Vincent

Or maybe we could talk about Django 3.1.

Carlton Gibson

The two things I'm excited about is the async view.

So OK 3.0 had the ASCII handler, which enabled you to embed Django in a ASCII environment.

Um so that's the foundation step.

But 3.1 is the starting where we you can actually write an async def view.

Um and okay, that's gonna be basic, and that's gonna that's gonna be fledgling as what we'll be able to do in future.

But it's like, yes.

So now if I I've got my Django project, I need to make a few API calls out, and they need they could be done in parallel without even running a different server, still with Gunacorn, still in the WISGI environment.

I can write a parallelized view which fetches those rather than having to do those sequentially, and that will be much quicker.

And that's that's just a quick gain without having to do anything else.

So, you know, this is the real start for yeah, we can start to do these extra exciting things.

And okay, we'll there there aren't going to be the async class-based views that yet that we'll probably get in a few cut, you know.

When we all learn how to write these views and we all learn what the patterns are, Django support will evolve.

But this is like the for me, this is like, yeah, actually, this is the real async bit.

This is the bit where we like, yeah, actually most of what you can do.

Markus Holtermann

You can then be possible.

And then and then right after next versions, we need this three-point uh pro uh the the the async for database level, I guess.

Because that's still not

Carlton Gibson

there right now.

I mean, yeah, I mean so yeah, this is the limitation is if you're still using the uh the ORM, you that still needs to be wrapped in a sync sync wrapper and executed in a thread.

So a lot of the things you want to do, they work they'll still be sync.

Yeah.

Carlton Gibson

But I mean Andrew might Andrew Godwin who wrote the the the views PR, we merged it and he's quickly joking, oh right, now the ORM.

It's like exactly.

Carlton Gibson

Um it's gonna it's gonna be exciting, I think.

Um I mean this I'm excited.

I've been right for years I had to spin out a Node.js on the side before before Django had async, uh before Python had async.

You'd have to spin up a JavaScript thing to do something async.

And then Python's had async for a little while with async IO, and you know, there are other options, but async IO being the standard library option.

And you think, okay, well, I can just do it with async IO fine, brilliant.

And there are a couple of web frameworks around that in um that we've talked about Tom Christie Starlet as as a go-to there.

But to not even have to change a web framework to do the basic thing, that's yeah, it's more and more stabilized all the time.

Markus Holtermann

That's pretty cool, absolutely.

Will Vincent

And I think uh because Flask is working on this, but it's sort of like totally different things too.

So not that it's a competition, but I I hope to get I I guess David Lord or someone on from Flask to talk about how they're doing it, but it's it's gonna be another reason that Django just marches into the future and you know, when they people say async, yeah, you can you can do that.

Though of course, like in I mean in Andrew's talks, to me the interesting thing is the use cases for async aren't as ubiquitous as maybe we thought they would or the community thought they would be five years ago.

Yeah.

Um like that to me is sort of the interesting piece.

I mean, you know, in the same way that we have HTTP too, but it's not aside from gaming and chat, maybe well per perhaps in you know in in IoT cases it's being used, but it's not used everywhere.

Markus Holtermann

Um the the the interesting part about or the part about async is that it's really giving you a lot of benefit and and when you have a lot of IO.

And frankly most websites and yeah, should chat and and all these things, they are not particularly normal websites in that sense because there's a whole part of this media part in there.

But regular websites, it's well, here's my my my view that fetches a few things from the database and returns a bunch of HTML for the most part, or returns an API a bunch of stuff in a JSON response as an API.

There's not a lot of not really a lot of IO happening when you compare it to a bunch of other scenarios.

And yeah, you may get a bit of speed up here and there.

But the occasionally I think that the mental overhead that you need to apply there in order to wrap your head around async can easily reduce the maintainability of the of that page then.

Yeah.

Markus Holtermann

Um comes with pros and cons is pretty much everything.

Carlton Gibson

Yeah, in the PR there was a note Andrew put, I'm sure, I'm sure it's there, it may not, it must be, it must be, otherwise I wouldn't be sure.

But um there was a note saying something like we we advise you to keep using sync until you've profiled and you know that there's a real benefit here.

Don't just jump onto the async bandwagon because you think it's cool.

I mean it is cool, but like that's not a reason to build your product in it.

Markus Holtermann

Yeah, absolutely.

It's it's definitely an interesting approach and and and interesting w way of writing code.

And I mean the whole front end part in web has approached that for a while now and has been doing async for quite a while.

But then in the front end you have direct user interactions where you want to do bubbles here and and show things they are um asynchronously, um, which you don't really have in a web server backend with like APIs for the most part anyway.

Carlton Gibson

Yeah, I mean there's there's some um was it live call it live view.

So there was uh the Phoenix project which is in um Elixir.

Yeah, they had uh they've got a thing called LiveView, and then somebody's ported that to Django.

There's a Django LiveView project which is really interesting.

I think they're I think they're using channels under the the pack.

But what's nice about it is that um the the front the say a form can do um validation on the server side because it it's doing what looks like local client-side JavaScript validation in the form, but it's actually pinging the server and getting the response there.

And one of the issues with writing decent JavaScript has always been, oh, I've got to rewrite my validation logic, and you know, it's always been a bit of a pain.

Markus Holtermann

Um there's the Batavia project from from the PyB project uh um which aims at um providing Python in the browser through uh cross like I was going to say cross-compiling to JavaScript.

I'm not

Carlton Gibson

just the WASM,

Markus Holtermann

um I'm not entirely sure, but I don't do entirely remember how they how they built the whole thing, but essentially can write Python code and then they have a Python yeah, what they have is essentially a Python runtime, so no compiler or something, um or RAPL.

It's just the interpreter um that you throw some Python bytecode at, and the interpreter is written in JavaScript, so runs in the browser, and then you run this Python bytecode in the browser.

Carlton Gibson

Yeah, that's kind of cool.

Um so it's part of the BWAR project.

Will Vincent

Yeah, I was gonna say, yeah, Russell's, yeah.

I think he referred to that in his keynote at PyCon last year too.

Where Probably, yes.

Will Vincent

Um that that specific, yeah.

Well, maybe uh for me, like a final question.

So this is something I was hoping to do in person at DjangoCon Europe, but since we're in a virtual situation, uh so sitting on the board, a lot of what we do is a janitorial side of Django, paying the bills.

But one of the things I want to do is be a little bit more aggressive around if we had a grant fellowship, if we you know didn't have to rely on Kickstarters for major new features, what would be some features that you think would be good for Django to add, assuming we had unlimited people and money?

You know, are there a couple that come to mind between the two of you?

I get I mean authentication is a big one, right?

Markus Holtermann

So I guess

auth could user overhaul, let's call it that, make it a bit more modern and adjust it a few um modern security or or authentication processes, like stuff like um auth or two-factor or in in in whichever way authentication.

Um I think the thing that's been on the docket for ever is a new admin.

There's this

Will Vincent

well right, it's just a million dollars, right?

Markus Holtermann

I don't even remember who that who brought this number up.

I I have the feeling this was Jacob.

I think.

Um yeah, if if if we have a million dollar uh million dollar and a few folks, I think you mentioned ten to ten people or so that's that spent a year, then this is achievable or something like that.

Um yeah.

Markus Holtermann

Well, I just

Will Vincent

it's I like that.

I think the big

Carlton Gibson

one on my list is the auth.

I'd like to see two-factor auth built in.

I'd like an easy solution for users to be able to you know have one-time passwords, have you know, yeah, all the other bits and bobs that come.

Um I

Markus Holtermann

don't think that's been go ahead, Carlton.

Carlton Gibson

No, well that's that's that's my one sort of battery that like there are other things that we could add, like nice little features that would improve it in a number of ways.

But my one big missing battery at this point is 2FA of some kind of modern you know, um use your uh you use your smartphone with its bio things bio registering security measures and j know that it's you that's logging in.

Yeah.

I think we could we could do that now.

There's I mean it it's a big job, but

Markus Holtermann

it's it's another thing that's been floating around in in a fairly long time, and I think kind of was dropped to a degree once the whole channels on once Django channels came around.

And absolutely once once it was clear that Django itself is going to have some async capabilities is an API for task execution.

So not the execution built into Django, but an API where you if going like I wanna put send off this task and do thing, and then whatever implementer implementation project uh or ever project is out there that wants to implement that can use and can build on top of that.

So your what uh just to pick one salary Django integration would um leverage that task that is or this task interface that Django or could anyway could leverage that task interface that Django uses and you define whatever this one setting in your in in in Django in or in salary and it again quote unquote just works.

Carlton Gibson

Yeah.

Markus Holtermann

But the idea is that you could replace salary with whatever um RQ or I don't even know what's what else is out there.

Carlton Gibson

But you might have an SQS backend, you might have a Redis backend, you might have a you know well

Markus Holtermann

that's that might not even be the level of where the integration goes, but this is it's been floating around like five years ago or something.

I remember having a discussion with that in Cardiff at the DjangoCon.

So that that was 2015.

Right.

Will Vincent

Well I well I hope that this is something that I hope to encourage more in the community because on the DSF side and as treasurer if someone said we need this new feature raise X amount of money there's a number of ways we can get that money.

So I don't want that to be the limiting factor.

I I hope to encourage that you know we again we don't rely on Kickstarters but it's sort of it's sort of the chicken and egg where I mean because the total budget for the Django Software Foundation is around 2000 most of it goes to the fellows then to conference workshop sponsorship and that's and then a teeny tiny amount for the ops and and whatever and that's it because we don't need more and we're not trying to raise a ton of money but if some feature was fifty thousand dollars you know whether it's getting a grant from Google which has provided help or

some of these corporations or you know there's a number of other ways we can um

Carlton Gibson

try to raise money.

Will Vincent

We can raise money in a way that doesn't go against any of the principles of Django but we need to know that we need it is the the first step.

Carlton Gibson

So that kind of brings us full circle because one of the things I'm really excited about the Depth 10 which is the change to Django's governance is that the technical board are of are meant to have a new role of helping to guide the technical direction of Django and to each major release to to sort of have a take a bit of time solicit ideas compile those ideas into a bit more of a feature roadmap because we've got this time-based release and we'll keep that but the technical board will hopefully be able to lay down some um

look we're aiming to improve Contrib we're aiming to you know introduce a a back end system if that's what the technical board come to the conclusion with consulting with the community then we will have that um that list of ideas which are that list of things we want which then you know the DSF board or the membership can act on.

Markus Holtermann

Yes absolutely um but that also um requires like ideas from outside or from people using Django or from people in the community to go like hey this would be cool and then while we I I guess for some obvious reasons we can't do all the things and we probably shouldn't do all the things but like the the the things that are useful for the majority of people where there'

s a possibility to build a API in Django or build the buttons and bits and pieces into Django that um then third party applications can use and leverage that to build a more sophisticated path to be used in as as um as applications.

I guess that's that's definitely something where we definitely will rely on the or need to rely on the community to bring up ideas there.

Will Vincent

So one of the things I'd like to do this year is to do a Django survey again which I think Tim Graham did in 2015 something like that similar to the Python survey where in addition to asking people how they use Django we could we could have a place to say you know what would you like to see in part based on your use case at your company because we're sort of getting at is that a lot of the times we're flying blind in terms of Django usage because we don't track yeah we don't have tracking in there.

So we don't really know a company's using Django unless there's something open source or someone from there tells us by design but that does limit sometimes the new features and things that we can add.

Markus Holtermann

Yes absolutely this um I know there was a discussion around integrating track some kind of usage tracking in Django which was I think fairly strictly um let's call it shutdown by the by the courting I I think there's a depth out there um like or dab proposal like four years old I'm I'm I'

m guessing here.

Will Vincent

Yeah I think it was it was shut down.

I mean because we can you can see on PyPI you can see the number of Django downloads but the PyPI stats are there's many ways that those are unreliable actually um so I I mean I I think our take to be conscious of secure of privacy and all these things is the right one but it does mean it takes a little more work to find out what how people are using it.

I mean literally I mean Jeff Triplett and I are trying to or Jeff Triplett's been working on a list of like the top 500 companies using Django and it's a bit of work to find that in part so we know who they are that we can ask them around features.

We could you know try to suggest sponsorships and stuff but like we have no idea who they are just um yeah without doing the work so the manual work.

Markus Holtermann

Uh the depth I was mentioning is dep eight uh gathering Django usage analytics.

Carlton Gibson

It's difficult I mean commercial companies obviously um often put this kind of analytics in their in their packages you know you download BS code it's got analytics which goes back to Microsoft.

That's not necessarily a problem you opt into all of that and you know about it but

it's not how

Carlton Gibson

Django's gonna have is it like

Will Vincent

I think the mess I mean we could message I mean for me we could totally read someone could we could look through Django project in general from scratch with some with fresh eyes, have a docs fellow or team I think there's a lot of ways that we could improve that and talk about a lot of the things that Django project and team members are doing that we don't spend the time talking about rather than

just doing.

Carlton Gibson

But it's capacity as well like the you you know that there's a group of contributors who are very active and there's new people coming in and you know some come and stay some come for a bit and leave some come for a bit leave come back again.

You know everybody's working quite hard on keeping Django moving and it moves fast.

You know look at the last few releases they've all been you know just major great releases.

Will Vincent

Yeah and that's and I hope that I I want to call out more attention to the people doing that work.

Because I know that everyone who's on you know our mailing list knows who one another is but most people don't know.

And I not that people do it for that reason but I think it's important to as you to your talks Carlton right we need new contributors there's a lot of strength but there's quite a bit of fragility when it's a half dozen people doing you know two of you are on this call are doing a lot of the working

boat call it's video call so if a meteor strikes one location this would be okay

Will Vincent

but anyways but I I mean certainly I view my you know my role on the board as being a janitorial a support role for the core you know

the technical team and and trying to enable that um so

Carlton Gibson

but yeah I mean we so okay that's that's a good point to wrap up because Marcus thank you for your work on the ops team on the security team on the technical board and everywhere you're around at Django Cons and on the community as well.

Markus Holtermann

Thanks Will Carlton for having me thanks everybody for still contributing to Django and like uh keeping this project running it's a pretty impressive what's happened for the last 16 years now?

15?

15, 16 yeah something like give or take?

Yeah.

Will Vincent

Yeah wow

it's quite a while it's gonna be a few more yeah more things.

Yes.

Will Vincent

Alright thanks again all right and everybody we're at Chat Django on Twitter uh DjangoChat command links to everything in the show notes.

Carlton Gibson

Bye bye.

Join us next time bye bye