Transcript: Modern Django Development - Jeff Triplett
Hello, and welcome to another episode of Django Chat, a weekly podcast on the Django Web Framework.
I'm Will Vincent, joined by Carlton Gibson. Hello, Carlton.
Hello, Will.
And this week we have, again, Jeff Triplett, who is a partner at RevSys, member of the Python Software Foundation,
and has his hand in lots of buckets in the Django world, so eager to talk again. Hi, Jeff.
Hi. Glad to be back.
Thanks for coming back on.
So right before we recorded, you were on a meeting for the Python Software Foundation. Maybe you could just mention what that is and what they do, since I feel like a lot of what we do is talk about what the Django Software Foundation does. But there's a much bigger one for Python as well.
Yeah. So I'm one of the board of directors for the Python Software Foundation. And so basically they're the fundraising arm of the Python organization. Some of this has to do with PyCon. Some of this has to do with fundraising for things like the Python Packaging Authority or that there's a whole lot of trying to figure out like, you know, with COVID-19 and trying to figure out like how to fundraise and how to support projects and stuff.
so it's just a non-profit that's been set up so there would be no you know commercial interest
to try to you know develop and promote events and education in the python world for the python
programming language even after being on for two years i've yet to get that down right so
you mentioned pip uh you mentioned the python packaging authority and that's that's behind pip
right so every time you go pip install you know django pip install django rest framework that
comes from somebody so that's who does fund that how is that funded how is it that the servers that
maintain that run and run reliably for millions of downloads every day right for the hardball
question from the beginning well it's an important question it is for sure it's uh and there's we can
link to there's a a chart i saw that usage has just skyrocketed too in the last you know year
but in the last couple years i believe right yeah you all should get earnest on some time to talk
about this specifically because it's a whole show yeah um so yeah part of this has always
been volunteer base but the psf kind of helps with some of the infrastructure and there's a
lot of donated infrastructure so i forget how many like terabytes of data it is a month but
it's a scary amount of data that goes through that you know when you pip install something
uh companies like cdns and stuff and i i don't want to quote a company for lack of knowing which
one it is but that's all cached and so you know it's a to me it's a very very scary world to talk
about packaging and how this stuff works behind the scenes which is why you need to get ernest
on to talk about it i think so okay yeah we should he's yeah i'll i'll ask him to come on i'm sure he
would do that um it's a good question if i can find that link to that article i saw that graphic
of usage and it was always high and then it's really gone up as python has gone up the last
couple years in particular oh it's one of the like scary parts of of python that a lot of people
don't talk about it i don't quite feel educated enough that will explain it any like i know how
i think parts of it work but i've also every time i hear it explained to me it never quite works the
way my brain has wrapped around it so i would just be doing it a disservice to try to explain it
before we move on to a different topic though is there a call to action for the psf for the python
packaging authority for something if you know i'm a company i'm using all of this i think oh i could
sponsor someone there so um yeah so they're doing some fundraising right now directly for packaging
and then any money that gets sent to that goes directly towards it there's also been a couple
of really large grants and i i think mozilla maybe gave some money towards it and then the
chan zuckerberg foundation which is from you know mark zuckerberg's facebook charity yeah and so
they put quite a bit of money to help fund some of the projects and stuff so that's one means is
the there's a direct fundraising campaign we can link up and then the second part is the psf itself
accepts money as well and any money you give the psf they can use for packaging as well as
just keeping the lights on so you've got two pretty good options there if you you know only
want to give for one versus you want it to go to both okay super nonprofits are kind of funny that
way because if you earmark funds like if i donate to like the dsf let's say but i only want to give
towards um i don't know like travel grants or something nonprofits are restricted to where
they can use that money so that money can only be used for travel grants so the psf works in that
way too so anytime you see like a specific fundraiser when you give money to that they
can only legally use the funds for that purpose that's kind of interesting i didn't know that
maybe one last question how does django or really any package or library fit into the python world
at the psf level because there's django flask there's numpy there's all sorts of packages
does it come up at all or is it really how does that fit in right because we're obviously jango
focus the jango podcast is it really to the side or is it kind of part of the discussions and
debates about the community um it's definitely on the radar as some focus but there's not a ton
that they can really do because there's just so many projects you know there are what 10 000
projects in python so the bigger ones definitely get on the radar and if if somebody like if if
one of these groups comes to the psf and says you know we would like to have help with fundraising
or we would like to have help with where things are stored then the psf can kind of help them
with that so maybe that's from a github you know organization perspective or you know from a let's
give you some advice and services because the psf actually has some staff on hand too that they're
able to help some of the like sponsoree it's called like the physical sponsoree program and it's
something they can do to help events let's say because they do have accountants on staff they
do have some legal help they do have like resources that are able to provide so some communities have
started taking advantage of some of this as well it's more focused for events but we've also seen
it i think like black joined the psf under the github org and there are some options there so
you know it's really tough just because if you have something like django you know django set
up its own foundation its own non-profit to to kind of handle its its money and to kind of help
advance that program so a lot of organizations tend to do that but if they need that help or
assistance they could ask the psf to be part of the psf or to have that project like you know
since the psf's already found a non-profit they could help manage money and donations to direct
it that way in the head towards projects they don't do as much of that but they're not against
doing that kind of work either be interesting because a project say like black like it needs
community support and it's really important and it's becoming more so but um it perhaps doesn't
have the scale to set up fundraising of its own or exactly but it's also one that gets a lot of
eyeballs so people are probably really interested in funding and so to me that's like i you know my
philosophy is when it comes to fundraising that we should make it as easy to let people you know
give money to these organizations while they have their checkbooks open and so not to plug github
But I really like GitHub Sponsors because most of the people that I know, either their companies use it or they use it for personal projects.
And some people already have their wallets open to pay monthly for things.
So supporting like the DSF through GitHub Sponsorships is easy.
The PSF I hope to see in that someday too.
And I think maybe, I don't know if Black is, but I feel like there's some other projects in the Python space that are more and more starting to utilize this.
And I just think it's easy because, you know, you're already paying your monthly bill anyways.
Most sponsorship options are, you know, pretty affordable for most people.
It's just a quick win, I think.
But also as well, you talk about that credit card already got their wallet open.
A lot of companies, a lot of managers will have a discretionary spend, you know, below, you know, X amount.
They can just okay it.
And if you can just put your credit card in and that's a win.
Yeah, I hadn't thought of that.
If we could like get you on a poster and have like a social media thing, that would be awesome.
where Carlton says, you know,
discretionary spend your money with the DSF.
I mean, this would go far.
Your corporate slush fund should go to nonprofits.
Okay, there's a listener quiz for you.
Send in your entries.
So look, I had a question,
which is since last time you came on,
there's one really big topic that's sort of come up
that the two of you have been involved in,
which is Django News.
You started this newsletter and I don't know,
it's fantastic.
Every week it arrives in my inbox someday
and there's more content in it than I can possibly read.
I think the backstory is Will and I were talking about projects, and I've kind of got this file.
Well, I don't know.
I like lots of side projects, and this is one that we were talking about would be kind of a fun one to work on, you know, to collaborate on.
I also do a lot of link stuff.
Like, I don't know if you've all heard of Pinboard, but it's just a link-sharing website.
I bookmark everything, basically.
And I know Will gets a pretty big volume of stuff through, like, Awesome Django.
And I think Will's perspective of being more focused on people who were teaching and beginners and new to the community, we kind of thought it was a good pairing.
I've been in the Django community for, I don't know, like 12 years or something.
And so we thought, all right, this is a good, quick, easy thing we could do.
I hate to say quick, easy, but it's just something that I felt like is a byproduct of links that we're already getting and resources we're already seeing.
And so we kind of had this idea to do just a weekly newsletter and at some point do more of like an actual web presence or something for it could be neat.
And the cool thing was when we were talking about it, essentially, I think it took like 30 minutes to actually do the project because in saying so, it's like we need a domain name.
I can register the domain name.
Will already knew about this site called Curated that is kind of like a link blog anyways, newsletter platform.
And so one thing I thought was kind of fun was we took the energy to actually do the thing versus spending months and months to build something to not ever, you know, to run out of energy to actually implement the idea.
And so, you know, this was basically a bunch of no-code tools.
I have worked on a Django backend for it, which will probably roll out.
I don't know.
It's been done kind of since December, but every week that I don't take the 20 links and put into it, now we have like hundreds and hundreds of links that I need to go and scrape and put back into the site.
but functionally i think it's it's there yeah so it's a it's a fun fun project that we both i think
independently we're kind of thinking of and i mean jeff is sort of one of my primary resources just
on twitter and other things for new projects so it's sort of what we are already doing packaged
up well i have to say it's super it's just yeah well thank you thank you well there isn't one you
know because i get it there's multiple python weekly ones there's react ones and i think that's
where i saw curated as one of the tools there's a couple tools and it was like well there should
be a django one um and you know so you'll note some people have noted that so curated.co which
we use is written in rails uh so some people are like why aren't you doing your site in django
which i was sort of sort of like well if you could see that it's it says pretty clearly that's
curated it's a hosted thing but anyways that was a question that came up but we resisted that
temptation though jeff does have this pretty cool dedicated site which which we will roll out at
some point um which has also been fun to to see i've done a couple prs not that many but just to
see how jeff does projects i mean that's one of the things i really like is working on stuff that
has a real world purpose but doesn't have all the like money and stuff involved it's really nice to
have discussions about like i've asked jeff a lot of questions around well why did you do it that
way i mean because that's very educational for me um i think for any developer to collaborate
on projects like that so um i mean well let's maybe in particular so github actions jeff you're
sort of famous in the django community for your advocacy of github actions and you're using it
in some interesting ways on the non-launched well not publicly launched site do you want to maybe
talk about some of those uh sure i i like github actions a lot because it is it i mean it's built
in github so if you're already using github you get ci rolled out for free it's also super fast
and so i've got pytest and pytest django every time you commit a pull request or you merge code
those are going to run if the build passes then i'm going to build a docker uh a docker image
and then i'm going to push that to github's package registry package registry is another
fun github tool that i don't think a lot of people have used yet but basically you can either push
your docker um your docker images to like docker i used to use get lab for theirs but githubs is
just super fast it has good caching and so you know we push the image to github and then i've
got a digital ocean setup that pulls for images and anytime it sees a new docker image i use a
product called watchtower it's another free open source tool and it just it's it's like
intelligently reloads the running image and so it manages the containers for us so it's pretty slick
it only takes like maybe two to five minutes to roll out any updates to the website which is
is good enough for what we're doing yeah i should also mention i you're one of my go-to uh resources
on docker as well since you use it often and carlton doesn't help me out there at all so
i have to rely on you for docker help yes i got a docker zing in i hear carlton doesn't
drinking game it's the first time i was on the show so here we go right okay fine it's okay it's
look so okay look docker right brilliant awesome love docker so you know i want to run uh post gs
this gis version this on that and okay quickly docker pull docker run do it super all of that's
just amazing what i see is a lot of people go jumping through a lot of hoops to turn that into
a full containerized deployment environment where it's that's just not necessary and i think for
my sort of objections aren't anybody who's doing it and having fun with it brilliant but i see a
lot of beginners intermediate sites small sites using totally inappropriate technology when you
know they should just be spinning up a single instance and deploying you know nice and simply
the old school way so when you say like the old way it was easier um i don't think installing
postgres and managing ports and copying a config file to manage access is easy and so i think you
run into this with every service like yeah i get it and when i take like a docker compose file it's
going to have a list of a bunch of services so maybe like for an easy project i've got two i've
got my django app i've got my postgres backend or database server yeah and so you know and some of
the ones we use now like i may have redis i may have celery so i could you know maybe i'm managing
five to six different services when i push something into production i'm not doing a docker
compose up to try to run all those on my virtual machine and that's where i think it's kind of a
pain and
you know, people need to realize like Docker composed to me is the shape of what I want my
production environment to look like. And it's managing those resources for me locally easier
than what, and I can configure stuff myself. I just think it's a pain to keep track of Postgres
databases and different Redis ports or different Redis database instances as well. So whenever I
push something to production with Docker, I'm just, I'm just shipping the image. And then I'm
going to be, you know, using like from database servers and stuff like that. Like I don't want
to home roll my database server either i want to use a managed server because there's a lot of you
know i would rather a company who knows what they're doing manage that stuff for me and i can
check and make sure my my backups are working and you know and i think that's a mistake some people
make i think they ship that docker compose file and then they try to do you know load all the
services up and they're like this is kind of a pain and you're right it is but yeah i think you
get a better level of service if you can use managed services yeah no i mean like managed
database service is just the best money you can possibly spend it's like you know whatever whatever
dollar oh yeah i could run this i've already got an instance i could squeeze my database server on
that same instance i could save myself eight bucks or 20 bucks or 50 bucks no spend the money on the
managed database thing and have the backups and have the updates and have the you know all of that
stuff that's the best money in the world yeah i think it's worth every penny for sure but i mean
i see docker as a packaging tool and a deployment tool and so it does help for local dev you know
sure but that ability to package it almost reminds me of like from a video game perspective like i
see a docker container like you would see going and buying a cartridge or a cd image you know
like if you buy a game and it's on i guess they're all dvds now but if you buy a game and it's on a
dvd server like i have that is like a press docker image in my mind and i'm putting it inside the
computer and so however much ram you want to allocate to it disk space maybe save game files
If you're using like a PlayStation or something that that's exactly that model fits my brain
for how Docker works behind the scenes, but I can add as many resources to it as I want
to.
So if I'm having trouble with my website, I can just double the number of servers or
virtual servers that's running on.
And, and I, it's just really nice.
Like the first time you migrate a server that has a dozen Docker apps on it, and you can
just Docker up or Docker compose up and run everything.
It's just magic.
And it's magic in a really good way of like, wow, like I still have servers that are probably
seven eight years old that are running outdated linuxes because it's such a pain to try to migrate
that stuff and so that's what sold me on it yeah no i mean i can see all of that and i see people
like yourself using it very successfully um and i have no problem with that at all and i think great
more power to you i then also see um folks who um are using or trying to use it because it's the
fashionable thing or because it's got a lot of mind space when they haven't necessarily um pinned
down that that that serves their requirements best um and that's you know
you know i may this topic came up because you know i made a couple of comments that
you know how i'm not a massive fan of docker and i don't you know take the instant take the
example about spinning up a um an instance and you say you've got linux servers that are running
outdated linux and you have not yeah absolutely you want to be spinning up new instances new vms
fresh fresh versions all the time but that's not an easy thing to do either so there's this
i don't know i i think it's a lot easier to spin up a new vm in this case because i mean it for
one i can just go to digital ocean or amazon or anybody and i can just run a docker instance like
that is a thing that takes 30 seconds to spin up and once i add my package registry to it which
again you can do with ansible or rsync or there's many tools to do it and once i have my images i
can just use a config file and docker compose up on that and i can run a dozen servers it's that
easy i don't have to install anything i mean you need to install a firewall for one so you need to
have a little bit of security mind if you have to do that anyway yeah no i mean if you config like
so take so to use the example um of amazon so on aws you spin up your things with ansible exactly
the same but you you have to configure the firewall you have to um you know set up your
virtual private cloud so that you you know your access points are not accessible to the wider
internet and the relations between your service all of that stuff's the same whether you're using
docker to actually run your processes or not you know whether it's containerized or you know
you just have to set up docker you don't have to set up you know you don't have to set up everything
else on top of that you would have had to set up before so i don't know i guess it's it's it's easy
to configure well it's not easy it's straightforward to configure docker and i feel like it's fewer
hoops to jump through than trying to set up um python with python path like i know will has a lot
of headaches about this and you've got sites dedicated to basically python path and different
os's and stuff there are certain versions of python that you can't run on modern os's and so
you can do that with docker through the magic of pulling a container and running it down which
it's not magic at all it's it's pretty proven technology and so that's the thing is like i know
for a long period of time the good old way i was really restricted to what kind of software and
libraries i could run on my servers because it wasn't supported by ubuntu or it wasn't supported
by debian and that was a really bad place to be like go grab this tensorflow library because you
want to work on ai and you just done something with jupyter notebooks now you want to put it
on your server oops you can't do it because you know lxml or some library you need isn't supported
on it right yeah no that's where it really shines right is where you've got some crazy dependency
set and this is why the example i use is um gis because to you know gis is it's great it's lovely
but the different gdal library and this that and the other and you try and no docker that to put
that in docker because it's perfect and it pulls it in it can you know wraps up all the dependencies
is lovely but again i come back to why i don't use it for my base app the deployments is because
you know to to deploy a standard django app into a known environment is not a difficult thing
like you've got a base vm that has that base environment in place and keep that that base
image updated and refresh that on an ongoing basis the same as you're building docker files
um and then to just to put your application bundle onto the server is not that was never
the difficult thing you know you can just rsync it or whatever um but then yeah as soon as you
like all right i've got to run this java based thing oh no i'm not going to install that then
i'm not going to install that locally because i don't want to put the libraries in place i'm just
going to use docker in that circumstance um yeah certainly that's where i do use docker and that's
where i do like it well i think it gives you a lot of things for free too because of like
being able to monitor cpu being able to monitor ram usage and allocation and i think if anything
if all docker really accomplished was that packaging deployment stuff that's fine but i
think it gets everybody talking about the same way to deploy things in the you know because i've
worked with hundreds of clients and docker's the only thing i've seen clients consistently do in
similar ways because you have somebody who learned scp files or rsync files or tar them and all kinds
of weird you know and there's dozens of libraries and python even in ruby to deploy stuff and so
it's kind of it's kind of the wild west honestly when it comes to deploying stuff before and now
at least with docker it's cool you have a registry somewhere i need to be able to get to that push
and pull images from it and so i i think it makes so i think it makes devops quite a bit easier but
and and you know to your credit well as soon as something else comes out that's better than docker
that is stable and works i i have no love lost with technology when it comes to you know the way
this stuff evolves and moves so yeah so i may have a docker hater shirt on someday but i think
the innovation is going to stay for a while but this is me this isn't you i'm not pushing that
on you so i don't have the docker hater shirt i like i just uh just like i don't see the pull
i don't see that you have to containerize every project every every yeah everything you don't
carlton and i think especially if you if you know i mean what is devops you learn one way to do it
then you go, I don't want to look under that rock. That's how many of us who are non-DevOps people
feel. And you have your way of doing it, Carlton. If someone already has a way of doing it, yeah,
if you can avoid Docker, it's a learning curve. If you're new to all this and you've never deployed
before, I think Docker is as easy and as future-proof as any other VM approach, which is
sort of more why I advocate it. And also, I've had to use it professionally. So yeah, it's good to
have nuance on this and it's it's fun to have something that needle you on yeah no i mean um
and get back to the github actions part i've had really good luck at copying pasting configs from
one repo to another and i guess with github actions it's workflows and jobs so i've had
really good luck copying those jobs and workflows and most of the time they just work i have never
had that success with ansible or salt or whatever the ruby thing was before that so and i i like
kind of this config bait i know there's a lot of basically these projects use yaml and there's a
lot of weird yaml hate in the python world which is kind of funny to me because a lot of people
came to python because they like the tab to eliminate the eliminations and um it's funny
going back to yaml and seeing python people complain about the white space and stuff is
it's absurd but well what is that phrase you know uh irony is a hat worn on or shoe worn on two feet
or something what is it carlton it's a british phrase maybe it's hypocrisy is a hypocrisy is a
shoe worn on two feet irony is a shoe worn worn on two feet i don't know that one actually you
don't know i think it's like churchill or one of those one of those famous british people
just making stuff up so just on github actions jeff i have been meaning to sort of ping you and
say well you know when are you writing up your you know your jango jango jangonauts guide to
github actions uh you know i would love to write one up i think we've had a couple of um i think
we've had a couple of links in jango news yeah there were a couple in the recent episodes there
was a couple of them it's so tough because so the segue i guess into defna so there's not going to
be an in-person DjangoCon US this year and so as soon as I can get off my dance card closing the
conference for this year and getting through all the contract stuff then I have time to write and
have time to do stuff that you know with PSF stuff as well and I don't know I've got a lot on my
plate so writing is the one thing that I want to do and strive to do more of but I just don't have
as many I don't have as much time to do that I would love to though if Will ever wants to do one
i can give them notes and stuff and but well perhaps you could perhaps you could put just a
few key links in the awesome jango perhaps it's already there um yeah so let's talk about awesome
jango so maybe this is relevant to anyone who uses awesome repos or wants to start their own
so jeff recently came aboard to help me because i was complaining to him about running an awesome
repo because i think there is this pattern where you you start one it's fun you get a lot of stars
because people like the awesome ones. But then you get a lot of PRs and a lot of them are kind
of questionable. Maybe it's someone plugging their own package or a company or it bloats out
and you get burned out on it because it's something you do for free. And so I was feeling
that. And usually what happens is someone lets it drop after two, three years and then someone else
comes in with a new awesome whatever repo. So I was feeling a bit of that pain and Jeff
offered to come in and help me out. So Jeff, how is it joining the awesome Django repo?
Oh, I think it was neat. I like seeing projects like this in Django because I think it's a good
way to point people. And I find it to be really useful from a, I need a tool that does XYZ.
Maybe I can't think of one, or maybe I've used five over the course of so many years. It's nice
to go back and look at them and have one resource to look and see like this has been maintained or
this hasn't been maintained and, and there's, you know, there's neat new, you know, people who work
on new projects and stuff may come and, you know, want to talk about their project on it. So even
if a PR doesn't make it, I find it to be, you know, pretty valuable. Yeah, exactly. Some, a lot,
a number of the early Django news packages were ones that people had pinged me about for awesome
Django. And, you know, if they weren't, they didn't have a lot of stars yet or something,
or they weren't there, I would say, well, maybe not yet, but I wanted to plug them.
But it is that curation is the problem.
You want to curate its place to look for stuff.
I mean, Django Packages, which is part of the Django Software Foundation now, is a great
resource and does some sort of ranking, but it's not as curated as AwesomeDjango.
Though the con is that AwesomeDjango is whatever you and I feel is a good choice, which is
nice to have that perspective.
But, you know, it's just two perspectives.
I think people like curated, though.
I think that's more, I think that's what we're missing because Django packages is really
good, but it is a firehose and they're, you know, every, I think the point of sites like
that is to try to catalog every possible option in the Django space where awesome Django,
I wouldn't call a project awesome if I were creating this movement, but no one asked me,
but it is what it is, right?
But it's, you know, being curated and being the cream of the crop, I think is, is value,
has value to it.
I think too, I was remembering part of why I created it initially, and actually there was
one before that had gone dead because the maintainer probably got burned out, is that I'm
asked a lot. I get a lot of reader emails and a lot of times readers will ask me, what package
should I use? Or is this a good one? And so it was sort of a way I can point people to this and say,
this is, as of now, what seems like a good option. And then there's some gray areas.
for example uh for a cms like just yesterday someone emailed me saying i you know want to do
a cms i'm looking at django cms um what do you think and that was a chance for me to say well
django cms is popular it's been around you might also look at wagtail um you know i don't have an
answer for you but i can make a recommendation and give a sense of you know curation where those
are probably the top two that would come to mind for me so anyways i'm just remembering that's part
of why doing the repo made sense is because i get asked questions a lot about stuff so
it's a way to answer it and have people make suggestions too one thing i noticed too on the
project which is um yeah so one of the more uncomfortable things is people try to use it
as a promotion tool for their commercial stuff and so that's one thing i didn't really think
about before you know you gave me rights to you know unimprove approve whatever make change yeah
Well, the content, I mean, in some ways I view it as, sorry, Carlton.
Well, you get that on like the Django docs themselves.
you know there'll be a pr come in for like some commercial projects and you're like we can't
really accept that i'm sorry yeah i was gonna say there's in some ways i view the awesome jenga
repo is it's a link to resources like the forum and and you know maybe the podcast that people
don't know about but the content piece is the one that's i'm not as sure of because obviously
i have a self-interest though i try not to make that you know too much the will show but there's
a lot of Django content coming out, which is great. There's a lot of Udemy courses. There's a
lot of books. A, I have opinions on some of those, and I don't want to be negative to anyone who's
done work. So I don't really want to be negative in public. And B, I don't have time to review
every Udemy course, and there's quite a lot of them. So that's the part where I'm not as sure
going forward how we juggle that, because a third-party package we can play around with or
talk to people and get a sense but content is content is harder um though at the same time
yeah you want to know what's what are the best video resources um i don't know if that's as
answerable a question and it's again it's slightly not conflicted for me but i'm aware that i'm not
doing awesome django just to plug my stuff but you know i think it's okay so it should be on there
if there is a content section that's my soliloquy on that okay so here's my great question about
docker while i've got you on jeff so i'm i'm a sort of crazy man i'll either just use ubuntu or
you know like the python base um docker image but i shouldn't be using that right i should be using
something better or slimmer or smaller or what should how should i build my docker images and
what's this build kit thing i keep hearing about what's that so there's two questions a lot of
questions there's two questions i think the python base image is fine i think that i think the base
images may be based on Alpine. And so when you, when you use the Python base image, you have
options like Python base image, colon, the version number, or maybe it's, you know, dash version
number. So Alpine used to be kind of the popular image to use because it's very, very small by
default. And then anything you install on top of that, you have to install like GCC and a bunch
of other options just to get anything I feel like that's useful on. And so Alpine takes forever
because it has to you know it has to pull down a full compile chain and the image so alpine is
great for i want to just run something in alpine that does what i want already when you have to
install everything you're adding time on how long it takes to build your images and you're adding a
bunch of extra you know your image is going to bloat you can start with buster and buster slim
and your your final output is going to take less time to build your image and it's going to be
smaller and so buster is the i guess bigger image and i believe it's debian based and so i'll
normally use what's called multi-stage builds in docker it's where you have one stage where you
install literally the world and then you will install like your pip dependencies and your
python packages and stuff and then you have like another layer another stage and from that stage
then i'll go and copy everything that i compiled from the previous stage and then that will be and
i'll base that on buster slim and then that will be where i actually run my development tools or my
my production image and so there's a lot of value to kind of knowing what your image options are and
what the final sizes are a lot of this works better from a go world because you have like a
compiler you know c world or something where you compile everything into one binary because if your
final binary is just two megs then you can take like an alpine or something compile everything
and then copy that executable or that binary file into that image and just run it.
And you have really small images.
Python doesn't compile down, so it is what it is.
So you're always going to have, you know, 30, 40 megs of libraries and stuff to have to copy and use.
And then BuildKit is kind of the where, and I'm a little confused by it myself,
but I know at one point Docker was going through this existential crisis and there's Docker and there's Mobi.
And I think Mobi is kind of the open source, what the company, when they decided to not
do commercial stuff, or maybe they've, I don't know.
Anyways, there's two confusing companies.
Mobi, I think, is the commercial interest now, or maybe that's the open source.
But they have a new project called BuildKit, and that basically is some experimental features,
and it's like trying out the new features that are going to be in the release of Docker
at some point.
I guess in the Django world, it's kind of like the minor editions or like the Django 3.1 and the 3.0.
But when, you know, the LTS version comes out, then all those features will be final.
But Docker kind of does their own thing.
So build kit's kind of nice right now because there's a few experimental features that will let you run.
You can build your images in a parallel mode where it'll pull all the image separately.
And so it just speeds up your image creations.
But worth investigating.
It is, absolutely, because it's just like one environment variable you enable,
and it speeds your builds up by a lot.
And so I like quick wins like that.
Yeah, yeah, sounds good, doesn't it?
If Django did that, that would be awesome.
Double the performance rate.
Oh, there's a secret one.
I didn't tell you.
As we conclude, I did want to ask,
you've written a number of interesting, I think,
interesting posts on your personal site,
and maybe we could call out.
So you have a Django release cycle graphic for one that you did
that i think is helpful to people because it is also a question i'm often asked like what's up
with django's release cycle and you built this little visualization tool for it yeah this is
based on dustin ingram did one for python release cycles and i think the django project actually has
a pretty decent one now too but i think it didn't capture maybe as much data or something there was
some itch that it didn't quite do that i was trying to scratch at the time but um yeah i think
it's nice to see because i think it's really confusing when people see like oh here's django
3.1 is going to drop but it's only going to be supported ish for what like nine months or a year
yeah and then yeah you've got the duration here like if you hover which is nice mainstream support
for nine months extended support for another nine months so the point if you if you're if you're
jumping from minor version to minor version you've got apart ignoring the lts's you've got
18 months right and then it's it's end of life so they you know if you there's two ways of going
about Django you've got to either update every nine months and you've got to be committed to
that and you know it's easy enough these days easy enough we say but it's easy you know it's
it's as easy as it's ever been these days but you've got to be on that update train you've
got to commit to it or you can be on the LTS is where you get three years you get the double
you get twice as long so one thing I keep getting asked Carlton is um I've I know a number of
authors and I guess one complaint is how quickly Django moves to which I say you know write more
books that's more book sales yeah but the interesting thing i had never really thought of
is they said from a book perspective it's easier if like django's lts was maybe the 3.0 and then
the feature branches come on top of that has has django core ever talked about you know this cadence
and does it make sense to do something like that okay so i don't know i like the the current
release cycle carlton just works here yeah i'm just a jam it's how to sweep the floor but the
the um i mean that kind of okay so the current release schedule was set right back around the
1.8 days um i think i'd need to go and look it up um but the idea was that the lts's would
if you if you can run without warning on one lts you should be able to update to the next lts with
only minor changes you know like you might need to some small copy and paste adjustments or that
kind of thing. And then on top of that, the APIs would be stable so that we'd have the depreciation
so that if a feature was going to be removed, you'd have time to update that and then you'd
get the proper warnings. I don't know why the 0.2 ends up being the LTS. And then that was just
what was decided back in the day when they were looking at, well, we'll make this number 2.0 and
this number then three 3.0 i thought it was a really interesting point because i can see where
like if you target you know a course or a book for like 3.2 and that's lts but then immediately
four comes out then it's kind of like are you running the old which is just interesting it's
it's a perspective i didn't i never had that perception before until you know talking to
a couple this isn't just me talking to you by the way this is other authors as well yeah i mean it's
100 will actually but no actually it is other people well it is i mean it is the challenge
for books for any framework of any kind is that frameworks change a lot
more quickly and so it's hard to do in book form i mean i thought it was just interesting yeah it
is i mean i mean maybe someone could put that to the mailing list and say well hey could we just
adjust the numbering system to make it you know more marketing friendly but the the interesting
thing for me is like is it does it really change i mean from a marketing perspective obviously you
everyone wants to buy the book which is for the latest version right and that's if your book is
for 2.2 and now it's 3.0 oh well it's out of date but django doesn't change that much anymore or
does it i mean you know if you're will if you're rewriting tutorials does it it's yeah so i would
say it changes five to ten percent which doesn't matter if you already know django but if you are
new to django it will stop you dead in your tracks so it's i mean i've come up tried to adopt the
mindset of it's a positive for those of us who can do updates that you know it's better it's
better marketing i guess to have an update book though it's a lot of work it's just confusing for
people i mean it's confusing because python two to three they kind of go oh is django two to three
a similar thing and changing the major release versions often which is the plan going forward
people you know assume that there's something major every time when yeah it's sort of the
cadence i mean we've talked about it hopefully in this podcast to educate people but i don't know
it's the difference between someone who's brand new and someone who's already in the in the django
world it's not i mean it's it's a pretty it's as smooth a transition as any framework i've worked
with but it sounds scary and it will trip up a beginner yeah well i think when you go to the
website too you know if you're new to django you go to the website and you go to download django
or see what you need to do and if you see like oh well django 4.0 is the latest version that i don't
think the lts necessarily and i need to relook at this so maybe it's not as bad but i think that
definitely trips people up if they go to try to find a four book because four is out and all they
see is a 3.2 book it just feels like a psychological difference that we're not doing new people favors
on that was less obvious to me until you know a couple months ago it might be worth a considered
approach to the mailing list to explain that and to discuss what what might be a solution there
because you know i think developers on the you know the best of intentions aren't thinking
necessarily about that kind of problem yeah i think it is it does matter for people new to
django i do i would certainly agree that separate from the author perspective it would be more
friendly but um it's not yeah the main concern of core django developers no it's interesting though
we do think about yeah like when so there's a there's a discussion on the mailing list at the
moment to change um request.get and request.post to something more pythonic to more you know like
maybe query params for instance um for request.get um and i'm a bit like oh that's a big change
Because for as long as Django has been around, those capitalized get and post attributes on the request object, they've been the same.
Okay, they'd work the same, they'd still be query dicks, but if those names were to change, then all of those tutorials back for the history of the project would just kind of need updating or be outdated.
It's like, ah, that's a big, it might be nicer afterwards, but I'm a bit scared.
it's like a seven to eight year cycle to you know yeah that's fine but yeah that's that's what i
see and it is weird because it's like request.get.get but it's like shouty case get or something
yeah and i think um jacob weighed in right i mean they took that from the php world i think it was
simon jacob was simon okay one of the yeah one of the three simon mentioned that last thing maybe
Jeff, I want to ask, so you have your morning routine written January 20, on your website,
which looks very lovely and leisurely about dropping your son off at preschool. And I was
just curious how your productivity has been the last couple months work wise. What's your morning
routine these days? So my son just started daycare again two weeks ago. And so it's closer to that
again. But yeah, it was kind of chaos there for a while. I've got a two and a half year old who
adjusted very well to life in this COVID-19 times. But yeah, I would be, my partner and I, you know,
split our time because we both have to work. And so I would have a two-year-old for the first half
of my day through about nap time. And so he pretty much would dictate the schedule. So he was a
pretty good coworker though. So he's got a little desk set up in here and he would watch, you know,
YouTube and we'd play and, you know, between like breakfast and lunch and stuff. I mean,
it was kind of chaos but it was a good two months though that i'm glad that i have just from a i
mean i wish the world wouldn't be you know falling apart like it's been the last two three months but
um i'm i'm grateful to have the positive side of you know getting to spend that extra four or five
hours a day with my son for you know two three months so yeah it's and you all i guess everybody
here is a parent so everybody has had similar impacts and stuff but i did think about redoing
that blog post or just posting an update just from the the covid life but i do have a draft of
it i just have yet to to publish it can we say you have what like 100 drafts of blog posts i probably
have i have 200 at least i'd say it's a problem my problem too is i'm dyslexic and so depending
upon what like for me certain writing things are really easy for me and some of them like the first
year i did jangle con us when it was a lot of me writing all the blog posts and the tweets
I would obsess over that stuff for hours.
I mean, some of it I would just do quick drafts
in the morning and it would take me a week or two
of fiddling hundreds of times.
And so part of that's my dyslexia.
And it's just the spectrum and it's a range.
So some days the words are there.
The next day I look at it and I'm like,
what in the world did I write?
So I've used a couple of tools.
One of them I'm not super happy with so I won't plug.
But there's some dyslexic fonts and
some you know random tools that are helpful for me but i never really know when i'm in it other
than writing just gets super super frustrating and so i've tried like recording myself from audio
sometimes the dyslexia kind of like because mine isn't so much mine is letters and words
but it also you know hits like communication for me verbally as well sometimes so i think it sounds
like a stutter for me when it's kind of at its worst yeah it's difficult because like ideas come
But then how can you turn those into something
which you can, you know, put out there?
It's, you know, is it video?
Is it audio?
Is it writing?
Is it, I don't know, sketches?
Like Julia Evans does these awesome...
The zines.
Yeah, her zines are awesome.
Yeah, they're just, you know,
they're just little stick figures and it's super.
And if I could do, you know,
GitHub Actions as stick figures,
I would love to do that.
Yeah, there you are.
Where's the tooling for it?
You need to build a static site generator before you can write a blog post, right?
Exactly.
And so, you know, and I, you know, circling way back to the beginning, when we talked
about Django news and stuff, I, you know, if people only get one takeaway from the show,
I think it's that like, we're in the Django world.
We obviously like our hammer is Django.
We'd like to solve things with Django and Python, but, you know, don't, don't devalue
if you take your time and put it into using tools that already exist so you can just get
into your idea and communicate your idea that goes a lot further than spending like 10 years
rewriting your blog engine like i know so many people do like it's absurd how many people tell
me that they've been writing their own blog for five years it's like just go use jekyll go find
a python static generator go use django cms use wagtail you know use a tool and get to your idea
and you know publish yeah it's the not invented here thing right it's easier to it's easier to
build your own from scratch from to take take sand from the beach and cast it into silicon than it is
to read the documentation on jekyll procrastination thing i think you go from the world of unfamiliar
to something familiar even if it's challenging but at least you'll have a bunch of content when
you're finally ready to write your own and you'll know how to write it so no i'll tell you so
congratulations on using a hosted service yeah it's a big step yeah yeah yeah i mean we did that
for years for DjangoCon too and some people got really mad and I just couldn't to me it was absurd
because we started using so for the DjangoCon US websites we were using just GitHub pages and that
uses Jekyll and so there was a weird kind of series of tweets or maybe people on Reddit who
I don't read or something were like I just it was it wasn't a ton of vitriol hate but it was a little
bit and I'm like you obviously don't know you know a lot of the people who help with conferences
they're still new to this stuff and the barrier of using get and the barrier of using Django
and I got really kind of frustrated before because I would see text on it you know like we'd see a
typo and then with Django by default nothing against Django but you know you have all these
great models all these great apps but when you try to find text you have to go and search five
or six different applications to find that typo then you still have to come back to github maybe
or get, and then get grep to try to find that typo. So it could be in a template. It could be
in JavaScript. It could be who knows where it's buried at. And so when we made the decision to
just use GitHub pages, it meant that anybody with a web browser without using get could just go and
make changes there. And it just, I mean, we have like hundreds and hundreds of contributions every
year from it. And even like when we let speakers know they're speaking, we can send you a link to
your actual you know presentation and you can go and submit to change your bio to be what you want
to upload new photos and stuff yeah i did i did that it was really easy from that perspective
and i wouldn't have yeah waded through a complex django thing to do that probably
and if somebody really smart out there which i'm sure there's a lot of super smart people
listening to the podcast if you could figure out a better static story for django i think that's
the one thing that django could really use is you know let's make django work better with the
Jekylls and some of the static generators in the world because it's just another output format just
like you know html or feeds or podcasts or any of those formats you want to consume a folder of
markdown files with yaml front matter and turn it into a blog page right or a series of blog
exactly or even you know outputting from a django thing to that stuff i think reading and writing
from front matter is a should be a solvable problem well there is a project with which
actually i'm on the core team though i should get myself off because i haven't done much in a long
time called lector l-e-k-t-o-r by uh the flask creator um i'm blanking on his name that where he
he did this um he built his own static site generator except he's quite brilliant and
prolific and he shipped it and it is a python based static generator that um it's basically
that and pelican but lector is quite a bit simpler and um and people are still working on it i think
there's a i still get the emails from the the team so uh you know uses gingia too for templating
since he wrote that as well so yeah i don't i'm not aware of a django version i don't i don't
really know if there should be a python one i find pelican a bit complicated and lector i really
liked when i was using it but i just defaulted to jekyll out of laziness i like that lector had
the admin so it had an actual gui you could use which i think is nice to be able to have like
you know form you know data structured data in ways that's the one thing i know that's a little
intimidating for people when it comes to like jekyll and front matter is you know sometimes to
to render your templates you need data to be in certain formats and places and stuff so
and i think django solves a lot of these problems too yeah for smart people is to take the drf i
would love to see drf be part of django which you can edit out of here but no i think that's my
wish list i think eventually that's eventually that's got to come right but so um uh django 3.1
i think it's 3.1 it might be 3.0 but introduces the first sort of steps towards um content
negotiation in the in the request so we've got the accepts method now where you can then
it will interrogate the request and tell you you know does it accept you know this particular
language or this particular you know response type or whatever and that's the first sort of
stage towards content negotiation which is what drf really brings you right okay this serializes
but that whole um multiple renders multiple passes thing if we could you know pull some of that into
the core i think that would be a good project but that's going to be over time because drf does what
it does very well and there's no there's no incentive to port it yeah i just think there's
a lot of wins that both frameworks have and i really appreciate you know work you've done you
know on drf2 and as well as django and then tom christie has some really interesting experiments
like is it type system or something is the i'm going to pull serializers and forms into one
thing like i've used it on several projects and really like it and my problem with django is when
i go back to using form code i miss so many features from serializers that it kind of makes
me wish there was an easier you know like if i could take the serializers from drf and add form
abilities to it i would i would live with that type system library and you know it's just so good
just melding those two together works really well for me yeah no i mean it's good stuff it's good
stuff all right i think we're we're coming up on time are there anything we didn't mention or that
you want to plug jeff um for listeners i don't know early morning i should be better plugging
um i mean we'll have my website in the show notes which is good yeah check out my website
jeff triplet.com um i'm webology on twitter uh django news if you've got ideas and stuff i i
really like hearing from people as long as you're not trying to pitch your product um tweeting at
you know will and myself is always good because we definitely consider those great well thank you so
much for coming on thank you super the thing i didn't ask about was tailwind oh yeah i was going
to talk to you about tailwind because oh yeah all right very quickly tailwind give me some tailwind
love jeff okay so let me give some hate when i first got into web the one thing that really
annoyed me not all designers which i have to i hate saying this and to start a phrase with it but
i i met some pretty profound uh designers who are known as the best in what they do and they
were really nice people but i found everybody else around that community to be very whether
intentional unintentional gatekeepers to design and what the process was like. And so I've always
found anything to do with design, this weird process of, you know, no matter what you do,
it's like getting hit with a stick that you're doing everything wrong with design. And so when
SAS came out, a lot of the same designers were like SAS is a bad tool for these reasons. And so
I've just always been used to really negative experiences with design world other than like
personal designer friend designers you know and so frameworks have always been very unapproachable
to me i think bootstrap was the first project that i saw that i thought was very you know i could just
take html and build things and it look okay and tailwind is kind of the opposite of all of these
frameworks where it is a include your css um it has a defined kind of style guide guide sheet for
how to like do grids and colors and different things. And you can just take those, drop it in
line and have something that looks really good. And I really appreciate what the designers behind
it have built because they have a couple of courses, which I think are good or a book that's
really good. It just kind of teaches you like, not only like these are the options that you have,
but kind of sets you up so you can fiddle with the design. So you can say like, you know,
here's borders, but I don't know why this border doesn't look like, doesn't look right, or why
these colors are off. And so Tailwind to me is the right level of fiddly that if this thing looks too
dark, you can just, you know, drop it back 10%. And they kind of teach you how to fiddle with your
designs to get something that looks better. And I really appreciate their, you know, approach to
this as well. Well, they also have the Tailwind UI project where they're going to have, you know,
for a fee, basically pre-built a whole bunch of, you know, five different ways to do a nav bar and
all the way down. So you can, you know, you don't necessarily need a designer in the same way you
might even with bootstrap, but it seems like it's, you know, cause there is that, like everything
looks like bootstrap. It seems like they're trying to have more options than just, it looks like
bootstrap, but still in the tailwind. Yeah. And I think tailwind, uh, sorry. I think bootstrap is
great by the way, for people who use bootstrap, there's nothing wrong with using it. Um, the
worst thing for me is starting with a blank page with HTML and trying to figure out how to create
something. Like it is the most overwhelming feeling. And I have so many projects. I have
hundreds and hundreds of projects. And so many of them, I never got to the design part because it
was just so intimidating to start with nothing. And so I think Bootstrap really does a good job
of giving you a lot of the batteries. The only issues I have with Bootstrap is when I want to
create something that Bootstrap doesn't do, the barrier to learn is really hard because you not
only need to know SAS or LESS that it's built in, you need to have a really strong fundamentals in
css but then you also need a strong fundamentals of how the bootstrappers particularly use their
framework and so i just find it to be impossible to use tailwind is pretty easy i think they're
using post css which is just like wrappers on top of css but you can the code is approachable
it's easy to look well you can look at the code and see what's going on and it's pretty easy to
remix what they have and so i've really every hour i put into it i feel like i learned something new
and I'm actually learning design skills for once.
And so I just appreciate everything you're doing
from that perspective.
So if you're a Django developer
who have the same annoyances and complaints
that I've had, then Tailwind is great.
Yeah, I've echo everything you've said.
I've had similar experience with struggling to,
you know, because obviously I'm a developer,
I'm a backhand guy, you know,
I don't claim to be a designer,
but it's nice to be able to come up
with something that looks presentable.
And then if you hand it off to someone
who can make it look better than presentable,
then that's great.
And I think Tailwind gives you the tools for that.
And I think it works in kind of an obvious way, too, from a developer.
Because I think one of the mistakes a lot of us made, if you're learning CSS, is you'll eventually do the, like, I want text-red.
And you show that to any designer, and they're like, you should never label your CSS class text-red.
It should be, you know, semantic.
It should be based on your content.
And it's like, you know, they're like, what are you going to do if you ever need to change your text-red to some other color?
Maybe we change the title of our blog post from red to blue.
And so, you know, as a developer, it's like, oh, I'm going to do a find and replace.
And I'm going to, you know, change text-red to text-blue.
And I'm just going to change it all and save it.
And they're like, no, you would never do that.
And it's just this weird set of rules that I, you know, I didn't probably articulate it well earlier.
But I've just always been very eye-rolly about, you know, how hard it is to do design because of these unwritten rules.
And a lot of, like, things that I think Django does well is not doing the same thing to developers.
and so and if we do we need to cut it out because that's just not cool well said good glad we got
that in my old man rant there at the end thank you no no no no i think we've all felt that i mean
with design it's it there is a lot of mystery though it's it can be analytical and it is true
that i think when you when you're a professional designer you have opinions on how to structure an
architect css um but maybe you don't articulate that as well and maybe it doesn't apply as much
to just individual solo projects but and i think what sold me on tailwind was just literally that
like tech stash the color classes and i'm like yes finally i've waited 20 years i feel like i
see some scar tissue there no but that first hour where you're like you know putting in these
classes and you're like well it's looking okay but i'm putting in all these inline classes and
like this is surely i'm breaking the rules and then that second hour it's like i mean i'm doing
this even more now and it's i don't really care about this when you hand it off to another
developer and they realize all they have to do is change the you know the class name and it just
works that's just such a good moment because i know a lot of i mean i work with a lot of developers
and you know it was soon in every designer completely rolls projects differently with the
way they do their sass and design stacks and it's so hard just to try to go through and figure out
somebody's framework that works really well in their minds but it's not communicated well
and so i really love the tailwind you know even if you don't know how it works you can kind of
figure it out by you know let's try changing red the blue and see what happens exactly okay we must
go thank you so much jeff for taking the time um links to everything the show notes thanks guys
always a pleasure thanks for coming back on and keep up the good work thank you all right bye