Transcript: Django Forum - Ken Whitesell
Hi, welcome to another episode of Django Chat, a fortnightly podcast on the Django web framework.
I'm Will Vincent, joined by Carlton Gibson. Hi, Carlton.
Hello, Will.
And this week, we have Ken Whitesell to join us to talk about all things Django,
the forum, and his long history with the framework. Welcome, Ken.
Good morning. Welcome. Thank you.
So as ever, we try to think of how to introduce our guests onto the show,
and it can't really narrowly put you in a bucket
all the things you've done to contribute to Django.
So maybe we could start with,
how did you get into programming?
And then we'll work our way into
how you became so involved in the Django world.
Oh my goodness.
We're trying to keep this at under an hour, right?
Let's try to give the condensed version here.
Actually got started with programming
with a programmable calculator,
uh, old, uh, TISR 52, uh, from back in the late seventies. Um, the time that had the little
magnetic card strips that you would feed through the calculator that would store the programs,
uh, and the thermal printers that you could attach to it. Uh, had a friend of mine in high school
who had one of those, and we just spent hours, uh, mucking around with that writing little programs
Really, it was my introduction that's what gave me the bug.
And then from there, everything just kind of mushroomed.
My senior year of high school, we had moved.
And I moved to a high school that actually had access to a mini computer at the time.
An old HP 2000.
Yeah, running the old timeshare BASIC.
And that was my first actual education in it.
And I caught the bug immediately.
I knew right then and there within like my first week of that class that I knew what I was going
to do for the rest of my life. Fantastic so that that trumps the the usual questions we're always
like so did you learn at university did you you know and you're like no I learned at high school
or at least got exposed to it. Well that's great that you both had access to a real computer and
then with the the calculator and games you could sort of have some sort of hands-on experience with
it because I think games for a lot of people was one of the first entryways for me because I'm a
little bit younger it was sort of the web the web came around when i was in high school um yeah
middle school high school so that was the first like tangible using technology oh what is this
thing kind of um that got me and a lot of people involved um though of course i had a ti 82 83
which is sort of the you know a couple a little bit later and i remember you could play tetris on
that you know mario brothers um i don't think i actually programmed it i thought it was programming
It was more like copying things from friends, but it felt like programming.
Well, it's one of the best ways to learn.
You look at somebody else's example and you decide to tweak it, modify it, and then you
end up with something that's, you know, kind of yours and kind of what you drew from.
Yeah, no, exactly.
And you need some sort of hands-on aha moment with why am I going to dive into the details?
So it's interesting to see what it is for people, whether it's a calculator or games
or the web or something else.
you have to kind of have that first right like because otherwise programming for the sake of
programming doesn't make any sense unless you have a goal in mind you definitely have to have the why
yeah so after high school then where did your passion take you uh well um family moved again
uh left me in a small town in pennsylvania uh with really no prospects i missed uh the
registration period for college, actually did not get into college at that point. And so I decided
to join the Air Force, joined the Air Force to see the world, spent three years in Biloxi,
Mississippi, and three years in Washington, D.C. That's one part of the world. Yeah. Well,
especially since born and raised in Baltimore, it's not like, you know, Washington was all that
unfamiliar to me. So, yeah, well, I see that. I mean, skipping ahead because we have our notes.
so i think the first time python came in the scene for you was was 99 i think which is very early on
in python sort of in python's history how did you how did it pop up on your radar so i was working
on a project at the time we were migrating some servers from windows nt to linux uh we were uh
using a very early distro, don't even remember which one now. And we had a need for a process
that would monitor a directory to see when files showed up. So there would be people who would FTP
files to this box and the process needed to detect the changes in the directory and then process the
files. And I found a snippet out on the internet, wasn't all that big, 20, 25 lines of Python
that would monitor the directory and then do something with it. And that something was what
we needed to do with it, run another script as a result of it. And I first took a look at Python
and it's like, okay, this is different than anything I've ever seen before. The syntax
significant white space. And it was certainly more verbose than the other languages of the time
that I'd worked with other than COBOL. And it just really appealed to me, actually. I
won't say I ever really had a fondness for COBOL, but I certainly had enough proficiency with it
that verbose languages were not a problem per se.
But something just with the requirement
that the code be laid out in a structured way,
unlike C, you know, with all the hidden gotchas
with the braces, missing semicolons, whatnot,
it really resonated that the layout of the language
just helped make the structure of the program
so much clearer than trying to pair up braces or parents or whatever and can i ask at that time
what would you say about the kind of abstraction level that the language operates at because you
said 25 lines of python it's kind of like the archetypal situation is i need to script something
up i do it in python oh it's 25 lines it's always 25 lines it doesn't matter what you're doing
compared to say the other language you mentioned c is like it's going to take you loads more than
25 lines to do it in C.
Like, so how was the abstraction level compared to what else you had available?
Mostly it was the strength of the libraries.
So the language is what attracted me at first.
And then I started looking at the standard line and looking at, you know, seeing the
comments about being batteries included and just starting to read through the library
documentation.
And it's like, wow, you know, there's a lot here.
It's not, okay, perhaps a bit pedantic of me.
It's not so much that the abstractions were at a higher level, but that the libraries
were so comprehensive that I didn't need to go hunting for a library to do X or to, you
know, find a code snippet somewhere else that did X.
Is that, okay, there's a function for that.
And I just call this function, and it's there.
Imagine that.
Yeah.
I had to look it up.
I think that was around, Python was 1.5 or so.
It was 1.5.
Stable enough to have the ecosystem that makes it so powerful of libraries and all the rest.
Definitely.
Yeah.
It's so interesting thinking about when people first see Python, what their reaction is,
Because, you know, many programmers like you come from much more less abstracted languages.
But when I was teaching college students, I would, who didn't know much programming at the time, I would just lay out.
I'd say, here's Hello World and, you know, Java, C, Python.
Just like you don't know anything about programming.
Which one do you think is easier to use?
Right?
I mean, you just look at it and you know.
Right?
Oh, yeah.
So it's sort of an interesting, you know, whatever level of programming ability,
you can just look at it and say, oh, you know, yeah, whitespace is very helpful. Oh, it's nice
that something is shorter. And also that if I want to print something, it's called print. It's not
13 lines of Copley Cook. So can I ask at that stage, you know, the 1.5 stage, were there
third party libraries that you ran into quickly? And what were they? Because, you know, later on,
it was Django and requests and, you know, these other big stalwarts of the ecosystem. But what
about then? At that stage, no, I really wasn't aware of the third-party ecosystem. My needs at
that time, I mean, at that point in time, let's see, 99, yeah, 99, I was still doing a lot of
low-level work with server management. The company that I worked for at the time was an insurance
firm. And they had 300 offices scattered around the United States. And so what we were doing is
that we had this rather intricate dial-up system that we would distribute updates from the home
office. We would dial to their local network, send files to them. And that was the purpose of this
code is that we would send data updates to them, whether they be rate changes or customer updates,
whatever. We'd send these update files out to them and then the system would receive the files,
unzip them and add them to the local copy of the database. Because at that time, there was no
wide area network that we could afford to implement through these 300 offices. Broadband
internet was still a dream in the future everything was dial up and so it was do the processing in the
home office distribute the files overnight they come in in the morning and they've got refreshed
data yeah but over the wire updates that's that's you know they're still doing that with iphones now
you know i get a little message that's true ulysses has been updated to the latest version
that's cool though that's really cool and that's so funny to me too because my brother-in-law
uses Django at a health insurance company called Zapari that does exactly that, you know, with
Django 20 years later. So it's sort of the tools have changed a little bit, but the problem is
still there about, you know, collating all this health insurance data. Yeah. You know, how do you
keep 300 computers in sync that aren't directly connected to any sort of internet or direct
networking. It's an interesting problem. Right. So Django, speaking of the web,
when did that emerge for you? So I first saw Django, it was PyCon 2005, I believe it was.
In my mind, I've dubbed that the PyCon of web frameworks, because that was like the time period,
the 2004, 2005 time period, where the saying was, you know, you haven't worked in Python until
you've at least written one web framework. And there were dozens of them floating around,
some better than others, you know, and a number of them just kind of faded off rather quickly.
But all of a sudden, out of the blue, there's this new one that poked its head up, said,
hi, I'm here, Django. And I remember at the time, Guido making some comment. I don't know
whether it was a keynote or just a talk or even possibly just an offhand remark, that he was
expressed an opinion, personal opinion, that, you know, he felt that there was going to need to be
some sort of shakedown of this plethora of web frameworks, you know, that there really doesn't
need to be 10 different web frameworks all receiving a lot of attention. And he kind of
thought, had a very favorable impression of Django at that point. So it's like, okay,
if Guido's leading in that direction, it's worth taking a look at it. So I did.
Then promptly had a position change, job change, same company position change, and
completely left the Python world. I had nothing more to do with Python
from a job perspective for about 10 years.
So I kept my eye on it.
You know, I've always kept my fingers in the Python world
as a hobbyist more than anything else.
But over the next five years or so,
I saw where Django as a complete web framework
really kind of gained the mind share.
But I never had a reason to work with it.
Then I actually did change jobs in 2014.
I had a company, another insurance company, hire me as a Python slash Django developer.
And while I acknowledged that I had no direct Django experience, apparently my Python knowledge
was adequate for him to say, OK, you know Python, you can learn Django, and dropped
me into the deep end of the pool.
I just want to point out that PyCon 2005 was, I think, only the third one.
And it says on Wikipedia there were only like 400 people there.
So you were pretty early.
I guess it was in D.C.
Was that you were based?
So it was maybe as local, but.
It was.
That's the point.
It was I was living in Baltimore, working in Baltimore at the time and, you know, said
to my boss, hey, there's this Python conference that happens to be local.
And he said, sure, no travel expenses, no hotel expenses.
Exactly.
by your lunch maybe
because now PyCon
is you know 4 000 people and but it's funny that you mentioned um guido because i went to my first
one 2019 2019 um after going to django con twice and i was like oh it's gonna be like django con
but a little bit bigger and it's you know orders a magnitude bigger but at lunch the first day i
looked up from the buffet and it was guido right across from me i was like oh man like huh i guess
it sort of like made it real in a way anyways just to get my anecdote in there but i just want
to point out, yeah, it wasn't like everyone was going to PyCon in 2005. It's also interesting
because when we interview people, there's quite a lot of people who, when they move away from Python
and Django professionally, their personal and community interest spikes almost as like an
antidote to their day job. And, you know, eventually they find their way back to the
fold professionally, but it can take a while. So that's not unusual.
Well, I've been involved in a number of different hobbyist communities through the years.
And what really struck me was how wonderful the people were at that first PyCon.
I mean, I met some people that they may not even remember meeting me, but the impression that they left on me, you know, the attitude towards people at that point.
Of course, again, you know, as you're saying, 400 people, a much more intimate setting.
And I walked out of there, you know, knowing this was a group of people that I wanted to
continue to associate with, which is something that I found lacking in a number of other
professional conference environments.
I'll put it that way.
But it's rare to have conferences built around learning and sharing as opposed to sales, maybe especially in technology.
If I think about, you know, that's something sort of take for granted going to PyCon and DjangoCon, but most tech conferences are a monstrosity of sales, effectively.
I don't doubt that, but that's, you know, I was thinking in terms of other hobbyist type organizations, other PC based groups or microcomputer groups that I have been affiliated with in the past, more so than the professional type conferences, because those at least I know what I'm getting into.
You know, you go to Share and are either of you familiar with what Share is?
No, no, no.
No, Share is the international IBM users community, if you will.
Dates back to the late 60s, back when IBM operating systems were effectively open source
because you'd buy your IBM mainframe, they'd send you the tapes with the source
And you had to actually build your operating system for your hardware configuration.
And so Share as a user community grew out of that as what sits in my mind as really
the first open source community, even though it was not known by that name at the time.
And so Share was an opportunity for main framers to get together and share patches and updates
and things that they had done with the operating system to make it work better.
And so, but share grew in the 70s to being, as you described, these ultimate huge commercial
endeavors as much as anything else, yet they still at their core tried to be focused on
the community, the fact that it's users helping users, rather than, you know, under the sponsorship
of IBM, rather than being an IBM conference. Yeah, I mean, I used to live in San Francisco,
where they had Dreamforce, the Salesforce version, which is sort of my main experience with
something that would just overwhelm the city for a week at a time. And, you know, they'd have
youtube play shows and it's just like that show silicon valley where you'd have tech people on
stage with musicians rings very true but anyways so django cons let's talk about those because
yeah django cons because that's where i met you came like you and that's where i met you too
came out to the us a massive long way and then come to the stagger to the desk get there i'm
like i've arrived you're like hello and i met you you're like the first face of django con that i
for? So how did you get involved and what's your story there? I like to think of myself as a very
selfish person. I know what I want and I'm willing to do what I think is necessary to help achieve
that. I want good conferences. I want good PyCons. I want good DjangoCons because I get more out of
a good conference than a poor conference. I also know from having been on the other side of the
desk, in the working at and administering and running conferences, what a pile of headaches
that is.
You know, I believe that every tech person should be required to run at least one conference,
if nothing else, to gain an appreciation of what that really takes.
And I've done my fair share of work on that back end.
I know the headaches that come with it.
One of the most serious headaches is wrangling the cats of volunteers to actually show up on time when they say they're going to be somewhere to get things done.
So you're like the Sergeant Major.
The absolutely critical roles is that person at the front desk to make sure that the people
coming in don't feel lost, know that they're in the right place, and are to some degree
acknowledged, you know, hey, you're here, welcome, we're glad you're here.
That's something I can do.
And I know by doing that, then the people in the back office who have more important
things to worry about than greeting the people at the front can continue to take care of
that.
And I can do that.
Quite frankly, it's really easy to do.
It's not that it requires a significant amount of effort.
It requires zero prep time.
I just show up and I do my job.
You got to wake up early in the morning, though, right?
Because like, let's be honest, people, you know, the first day they're there at like
730 a.m.
And by the last day of a multi-day conference, it's, you know, more like 10 a.m.
when people roll in.
But they're already registered, so less to do.
Yeah.
Yeah.
And the workload tails down.
That first morning rush is always entertaining.
But I'm a naturally early riser anyway.
I've worked for many, many years, like a six to two, six to three shift.
So it's not unusual for me.
And then when you think about conferences being on the West Coast, that does not help matters any because, you know, I'm waking up at 2 a.m. in the morning, first couple of days.
And again, you know, 3 a.m., 4 a.m. in the morning, what else are you going to do?
Well, you get up, you have breakfast, got nothing better to do.
Go downstairs, start pulling out tables, setting stuff up, and you're ready to go.
Well, Carlton and I, I felt we felt quite pleased with ourselves, with our strategy at the last DjangoCon where, you know, because Carlton's coming from Europe and I'm just from the East Coast.
And, you know, so we got up and we did bike rides every morning.
I think we were out the door by six, Carlton, right?
We got.
It was it was quite early.
Yeah.
Yeah.
It was good, though.
I mean, it sounds too much like exercise.
It was quite a lot like exercise.
Will obviously goes to the gym or something in his normal life, whereas I'm a bit like, oh, what's that?
I remember those from childhood.
it's a bike yes but but both of us met you at the registration desk and then i volunteered
the ones after that both at pycon jango con and and you're right it is it's so overwhelming the
first conference you go to because you don't know anyone you don't know what's going to happen and
then to to have a friendly face faces um sets the tone for the rest of the conference for sure i
mean i was you know in that bucket my first jango con and first pycon as well so it's a great way
to meet people as you said i mean you know if you go to conferences to meet people instead of having
to you know chit chat at a table if you work at the conference desk you're just bound to meet oh
i'm horrible with small talk yeah absolutely yeah it sort of solves that problem uh it really does
so maybe i can ask since you've been to way more pycons and jango cons than either of us
what's your sense of how the Django cons in particular, and just the community has, um,
developed over the last, you know, five to five, 10 years in particular, what's your sort of broad
sense of all that? Um, I mean, the, the Django con community just continues to amaze and impress me,
because of the focus and the intentiveness on the user experience, the customer experience,
the attendee experience, however you want to phrase that, you know, for really putting that
focus, that emphasis on trying to make everybody feel welcome and accepted. And hey, you are one
of us it doesn't matter where you're from it doesn't matter what you do in your job or not do
you know student hobbyist whatever you took the effort made the initiative to come here
you're one of us now and we're going to do everything we can to take care of you and that
that includes briefing like the other attendees right so that when the when the conference starts
There's always that kind of half-hour presentation about, you know, what is a DjangoCon and why is it so welcoming?
And, you know, they have this idea about standing in the Pac-Man rule where you always leave a gap for someone to come and join.
And then, you know, this idea that how many N is the number of DjangoCons you've been to?
Well, you know, N plus one, you've got to meet that many people each day.
So, you know, if it's your first one, you've only got to meet a couple of people.
But if you've been to 15, then you've got to get out there and, you know, really get to know folks.
It's just little things like, you know, they're not little, they're massive, but they really structure the day for me and they structure the conference and structure the mood.
I think that last point there really hits it for me. Striking that mood, setting that mood for the conference that, okay, yes, it is DjangoCon. It's not that it's not about Django because it very definitely is about Django, but it's about the people working with Django.
And that's a mood that I think can't be overstated because it's just so absolutely critical to the experience of the people attending.
And I do want to note, I mean, specifically for the US Django cons, there's, there's Defna, the Django Events Foundation of North America, which is a nonprofit that exists to support Django cons, because each one requires a lot of work by people on the ground. But to have an overriding organization that helps with everything makes it a lot easier. They also they contribute to the Django Software Foundation every year, whatever proceeds they have from the conferences.
So certainly for the U.S. one, having having that organization, the people on it, Jeff Triplett, Craig Bruce, Adam Fast, there's some others that's in a way thankless work.
But hopefully people, you know, you go to the conferences and you meet them because they're the ones running around, not at the conference desk, not speaking, but doing everything else to make it a great experience.
Absolutely. Yeah. Well, let's get to the forum.
So this is actually before we get that. Congratulations on winning this year's Malcolm Trudnick Award.
Thank you.
That's no small thing.
And that's an annual award for contributions to the larger Django community.
And I think in particular, a lot of the people who nominated you mentioned the Django Forum.
So this is something new.
And you are, I think, far and away the biggest contributor.
So maybe you could, let's talk about what the Django Forum is.
And I'd be curious to hear about not just your involvement, but what you've learned
engaging with so many people this past year or so on the forum.
I must confess my initial reaction to your statement there.
I may or may not be the biggest, but I'm probably the most frequent.
Well, you pick the metric, pick the metric you want, you know.
I am probably larger than the average member.
Anyway, but leaving that aside, trying to become serious here.
So on the forum, there's all sorts of questions.
There's more advanced topics around where to put the logic, favorite third-party packages,
but there's a lot of people new to the community who have questions on getting started and
more fundamentals.
And in particular, in that area, you've been very active.
So I'm curious, how have those interactions been?
Because it's sort of like being the registration desk in a way that people ask a question and
they don't go to Stack Overflow.
They go to the forum, which really has experts.
So what sort of patterns do you see, right?
Because a lot of times it's kind of the same question over and over that beginners have
around getting started in Django.
It is or it isn't, although I do tend to kind of paint a broad brush for some of the real
recent people who are diving into it.
I know that I emphasize a lot the two, what I consider the two most frequently used or
reference tutorials being the official Django tutorial
and the Django Girls tutorial, which I think both are very
excellent.
They both cover a broad span of subjects.
from slightly different perspectives, and I recommend both highly because they'll give you
two different angles on something. I know for myself, when I'm learning something new,
I can't just look at it from one angle and expect to understand it. I typically need to look at
something from two, three, or even four different angles before I start to build a mental model that
resonates. And I still remember from seven years ago now, what my sticking points were with Django
and the difficulties that I had in learning it and moving from the other frameworks that I had
worked with. And I know I have detected that for the people coming in who are new to Django,
you know, you can divide them into two very broad categories. There are the people that are new
to web frameworks in general, and they're just learning Python and they're just learning Django
and it's, hey, I want to produce a webpage. And they have one mindset or one perspective that
they're coming from. On the other hand, you have people that may have experience in other web
frameworks, whether it be Spring or .NET or one of the PHP frameworks, Drupal, WordPress, whatever,
that are moving to Django, moving to Python.
And they come at it from a very different perspective.
Because the first group is, I don't know how to do X.
How can I get to point X?
And those are the ones that I try to steer to the tutorials initially.
Because, you know, they need that foundation something to build on.
You know, here, build these basic building blocks.
Then if you still have problems, we at least have a terminology, a common terminology that
we can work forward from.
But let's get some basics out of the way.
Let's make sure that we're using the same words for the same things.
Then on the other hand, you've got the people that are coming from a different framework.
So they already have some idea of, I want to do X, and this is how I would do X in framework
X.
Now, how do I translate that to Django?
Yeah.
Where's the controller?
And that, yeah, and that is, can be a much more challenging issue because they actually
have to unlearn the familiar patterns of how they would do things in that other framework
and recognize the fact that Django has its own patterns, its own ways of doing things
that aren't a direct translation
from a different framework.
And the phrase that I use most often on that
is don't fight the framework.
Don't try to make Django work like WordPress.
Don't try to make Django work like Spring.
You're going to create yourself headaches.
Don't change the framework, change your mindset.
But that applies at every level.
I mean, quite often I do client work
and i'll go into a project where they you know they've got me in because they they they got a
project that's struggling they've got to the point where they kind of can't progress further because
of you know technical debt reasons essentially and more than nine times out of ten the issue is
they're fighting the framework they're trying to push it into the wrong way and so you spend a lot
of time moving things around so it starts to look like a django app again and then all of a sudden
they can breathe and it's like ah we can make movement now and we can and so it's whether you're
a beginner or not go with the grain of what it's trying to do for you and achieving that mindset
actually is one of the best benefits of attending a conference such as jango con or you know whatever
again whatever framework it doesn't matter the documentation can only take you so far
the document documentation can tell you how to do x but most documentation for pretty much any
framework i can think of does a pretty poor job of saying this is how you should think about x
you know this is how you need to approach the problem so that the solution you're trying to
implement makes sense. Yeah, it's how versus why. I think it's harder, especially for official docs,
which are typically written by a community to maybe agree on that is one piece. But it's also
the case that I've thought a lot about the fact that there's a difference between docs and
tutorials. And people confuse that and want both. And I understand that, but they're separate for a
reason. And a lot of the times when they're complaining about the docs, what they want is
a tutorial that provides that that sort of top level um you know perspective as well as the
details which the docs can provide because the docs can't be a tutorial it's already
a massive well-documented thing to to be what it is um but you know so the forum in particular like
some of the um questions i've engaged in are i think a little more in that top-down perspective
where around like one of the ones I think that a lot of people responded to was where to put the
logic in Django. Because as you progress in your Django journey, that's a very confusing thing.
And I think maybe especially if you're coming from another framework, because the reality is you can
do it a bunch of different ways. And there are some best practices, but it sort of does depend on
how not to fight it. So I guess I'd be a tee that up to both of you. If someone says where to put
the logic in Django. So my quick take is I would say if you can put it in the view, that's great.
The model is probably better. I wouldn't dive into model managers unless you really have to,
and I would keep it out of the templates. That's my really quick take. But there's a lot of ways
to do it? I know, not an easy question. There's a lot of response. We'll link in the show notes to
the, there's a lot of responses in the community to this question because there isn't a simple
answer. There's not, and it is so context sensitive. You know, there are cases where
model managers are the right answer. There are cases where model managers aren't the right
answer. For any of those locations that you identified, there are specific situations where
they are or are not the right answer. And so I don't think you can make a blanket statement
that your logic always needs to go here. And yet people want to know where to start,
though, right? I mean, that's the thing is like that is the correct response, but they still say,
okay but but how and part of it i've seen too is sometimes people depending on where what their
background is not understanding what django can do and what django can't do so a lot of times they
want to like pull in data from somewhere else an api or a database and they don't really know where
to do the logic on that so a lot of times it's well django is not going to clean your data for
you or i even had a long back and forth with someone who's like what does django even do for
me i was like it does the web part for you but you know because this person want you know i love the
projects that beginners have because they're just they're they're so you know for those of us with
experience it's just like that sounds awful and like that's going to be impossible but they're
like well i want to pull in this and this and this and make it real time and you know um they're sort
of unencumbered by by reality which is good because it makes makes us think about you know
what could happen but so much of it is outside of jango scope wanting to apply logic to things
which is like yeah write a python script you know django's not gonna django can't help you with
that anyways some of some of the emails i get with carlton what's your response you've been quiet
yeah okay so um you know ken's right it depends but one one analogy i always go back to is the
this idea of application layers right where you've got say the um the model layer in the middle and
then you know a validation layer around that and then you've got a view layer perhaps and then some
some ui bits around that perhaps you know this this is an old software architecture um way of
thinking about it and i think that works quite well with django in that you've got the the model
layer for you know business logic and so one thing i do use managers for is to create a custom say
create method where i need to pass in a couple of parameters and there's a bit of special hunky
dory logic there i want that inside a manager not or inside something i want it encapsulated so that
rest of my code doesn't have to see that nasty. And so I quite often use managers or custom query
set methods for that kind of logic, because the view then can pass in to the model manager just
what it needs, and then the model manager does that business logic. And then what does the view
is left with? Well, the view's job is to take an HTTP request and turn it into an HTTP response.
So is this logic related to view handling, HTTP? If it is, it belongs in the view.
Sometimes you get some data from the view
and you want to pass it to the model layer,
but you can't just pass it straight in.
You don't want the model layer throwing out DB errors
because you passed it bad data.
So that's where we'll have a form.
And sometimes form logic can be quite complicated.
And particularly a model form, when you hit save,
it gives you back an instance.
So any kind of logic about validating the data
and getting it ready to pass to the model layer,
that lives in the form.
And then, I don't know, you might have an HTML button
that you it has different um values and depending on i don't know what's going on on your site and
so you might create a template tag for you know site app button and then you might pass it a
parameter and it it does all the the fancy logic to generate the html that you don't really want
to put in get context data right i mean you could call it from get context data but you know then
you'd need a little helper function to keep it tidy well it could just live in a custom template
tag which are really easy to write folks you know you know the dtl is actually super powerful um
So again, it depends. But that's how I kind of think about it. I try and think of what
layer does this. And what I don't want is the model layer having to reach out and do
something for the view layer. I don't mind the view layer reaching down to the model
layer and saying, hey, please, can you provide this service for me? But what I don't want
is it the other way around. And try and keep some sort of cleanliness like that. But beyond
that, it's impossible to say without a concrete example.
Well, in that, what you just said, Carlton, you've referred me to, we'll put
the notes tom christie has a post from 2014 sort of to your point on jango models encapsulation and
data integrity um yeah no i will i will link to that to the heat death of the universe that is
such a great post it is it's just amazing and more or less that i don't quite agree with him about
model forms at the very end but the rest of it is dead right and there was a debate recently
um somebody wrote a book um about i can't remember the exact title it was about um creating a service
layer and they were very anti um oh yeah django and the orm in it and there was a couple of posts
one by james bennett and another one by um luke whose surname escapes me momentarily
yeah reply yeah replying about you know how you create a service layer in django or how you avoid
creating a service layer using the orm the way it wants to be used and again this goes back to
cutting with the grain of the framework well and in the forum discussion um andrew godwin and some
some others talk about that services, um, argument. Cause I think it was timely when that was brought
up. But I think part of the thing is, you know, we like, if I was going to teach someone this,
you almost want to show them, well, here's the five ways you could do that same, you know,
save method so that they have the context to understand why one is better than the other.
Cause a lot of times they don't know how to do any of the five. Um, so to talk about, well,
this goes here that goes there they sort of need the reps to understand how the pieces fit together
i think right like i thought about like how many different ways can i do it to do app or uh even
hello world actually i have a post on hello world done five different ways which i think is quite
clever but i think i haven't explained it well enough to get it kind of get at this you know
multiple takes on the same issue to show how the pieces fit together um because it does take quite
a while to understand how the pieces fit together in django does your uh do your ways include uh
carlton's single file way of doing a hello world and he showed it uh django kind of you know i have
a i'll link to that too i made a i made a whole github um repo for that and there's been discussions
i don't know if i do um uh i'll put the links in okay yeah because i think it's the thing is is
that by the time you get to showing how to do one thing five different ways you've lost most people
so you know like this hello world one i think it i almost don't i don't mention it to beginners
because i know it's just going to confuse them when i'm like you don't actually need to have a
views.py file like you can stick the view in there and you know and then carlton's thing is just you
know that's mad scientist realm but i'll put the link in there that's just to show how it all fits
together right i would i have created and do create single folder django apps right but a
single file django app nah yeah okay so i see i'll add it actually after this so i have it it's
django hello world five different ways and i'll put a link to carlton's talk yeah because i have
a whole repo with the code because carlton put the code up on his slides but um yeah
how quickly i didn't go any further how quickly can you lose can you lose uh you know someone
asking a question about Django. I think the point you made just there, Will, was about reps. That's
why I like books, guides around. I think we can't have it all in the Django docs, as you said,
but books like yours where you can go pick it up and you can go through it and there's several
different projects and there's different things and they teach you the different aspects. I think
that's an essential resource on the side. You can't just have it all in the Django docs because
they've become unmanageable they're already you know massive i mean i almost think that another future book
would literally be a book on the simplest crud site done five, 10 different ways to, as a
intermediate level, um, thing just to illustrate, uh, all these kinds of points, like just to show
like, well, cause I usually in the beginner's book, I sort of, I talk about different ways to
do it, but I show the way that I think is the most elegant, accurate way for a beginner to do it. I
don't overwhelm them but maybe for a next book it'd be like well here's our here you know here
are all these different ways you could do it um that might actually be an interesting thing though
i i feel like it yeah it's hard hard to know what people will want but they should they should go
through something like that if someone felt inclined to make it but speaking of django um
we're coming up on time ken but uh one of the questions we wanted to ask you was ways to improve
Django in the broadest sense? You know, if you had a magic wand, what are things, you know,
technical, community, otherwise, what do you think are some ways that Django can improve itself
going forward so it stays relevant? I consider myself kind of an outlier in terms of usage in
the Django community. I've known from talking to many people, how I use Django is really different
from most people that I talk to, I'm not sure that I actually have a good opinion
on that question because for what I do with Django professionally and hobbyist out of the
mainstream in terms of, you know, you think about Django, it builds websites. And so what is a
website. A website is designed to present information to people. Okay. I do that, but
the appearance of the website, how it looks, how a person interacts with that is much less important
in my job than the actual data that I am retrieving and displaying to the user.
Uh, my websites will never receive any awards other than possibly a Razzie for, uh, their
appearance for their look and feel because I'm writing websites for internal company
employees in very small numbers.
Uh, you know, my average, my average website has two users.
Yeah, right.
That's quite, that's my average user base per website.
And look and feel just really isn't an issue there.
I just need Django to be able to go out, collect data from different sources and present that in some way that an engineer can look at.
For example, my current project that I'm working on, I'm decoding TCP dump PCAT files.
And I am decoding them and presenting packet level displays
so that it's, in a sense, it's Wireshark through a browser.
I was just about to say that.
It's Wireshark in the browser, but he got there first.
Yeah, but it's even more targeted than that
because I am picking out particular fields.
It's not presenting the full frames.
It's highlighting specific data fields and organizing that
So that an engineer looking at the network traffic sees at a glance what it is that they're interested in saying.
I think this kind of thing is more common than you give it credit for.
I think most people are doing, I think most Django engineers aren't touching the front end at all.
But like low traffic, like it's an internal application.
It's not, you know, you're not trying to serve a hundred people concurrently.
You're trying to serve a hundred people a month sort of thing.
And that's very frequent.
And, you know, these kind of internal data analysis type presentation, I think that's a lot, you know, obviously the agencies that, you know, you go to the conferences, it's like, oh, we work on this big site and that's user facing.
But I think a lot of people are using Django in this way.
May very well be.
So what would you, what would make your use case easier?
Honestly, I don't have an answer to that.
You know, part of it is I've gotten so used to Django as it is.
I've become very comfortable with what I'm doing, with how I'm doing things.
I think the biggest improvements that I've seen over the past couple of years has actually been in the tooling around Django itself.
You know, had you asked me this question three, four years ago, it was like, find me something that lets me get rid of Eclipse, please.
And with Visual Studio Code now, Eclipse is ancient history.
You know, so it's all the tooling that is, you know, maybe I'm just becoming more aware of it.
But things like Black or Pep8, you know, other facilities of tools around Django itself that is making it a more complete environment that I'm seeing the things now that I was used to working in a Java Spring environment or .NET.
You know, I'm seeing this type of first class support around Django.
So it's not that I have any recommendations for Django itself.
It's that I'm giving huge kudos to the people who are working around the fringes, you know, who are doing things that are adding on these external features, though, that make working with Django that much easier and that more seamless in terms of keeping things moving forward.
yeah super super and so if to follow up then what would what would you say say the last 12
months is your favorite package that you found that fits in that club oh put me on the hot yeah
come on oh well we were just on talk python and michael kennedy always asks his guests that at
the end so i think that's why it's gonna be our new one i'd have to say what has changed my life
most significantly in the last 14 to 15 months has been a much more aggressive use of Visual
Studio Code and getting it integrated into my workflow.
You know, I started out using it as a Eclipse replacement, you know, basic editing and putting
projects together.
But as I continue to work with it and learn how it works and understand how to do things with it, the different configuration files like custom launch.json files and using the debugger with it, I've just more integrated.
I've gotten more in-depth, more comfortable with it more as a tool than just an editor.
Yeah.
Okay.
That's a good one.
And so that's been my biggest improvement in my workflow over the last year.
okay super yeah well i think all all three of us that's our primary editor these days i know
carlton you bb edit right you have one that you yeah yeah yeah occasionally but yeah so i've been
using bb edit forever i have it open all the time because um as great as vs code is and it's
multi-file search is very fast when you're trying to pick through say i'm trying to um pick through
a um a trace in django and i'm trying to have all the source files open and all the rest bb edits
multi-file search is just phenomenal and you can you can have the different searches open in
different results windows and you know vs code doesn't like you doing that because it's got to
fire up a javascript it's basically got to fire up a new instance of chrome for every window you open
with like that's fine but you can only open so many whereas bb edits a native mac app and
it's it's for that kind of um forensic research through a big code base it's indispensable for me
i still use atom too i mean sometimes i just want a different editor i want something my atom config
is very very very basic and it's sort of like in a way my bb edit because my vs code is all
customized and sometimes i just don't want to deal with any of that i just want something
simple so oh yeah it's i still use notepad plus plus for some things uh nano on occasion you know
if I just need to hop onto a server
and make a quick patch or something.
Yeah, you've got to be comfortable
with lots of tooling.
Are you on Windows, Kim?
Can I just ask?
My primary development laptop here is Windows,
but I do a lot of my development in WSL.
Yeah, I was going to ask,
so are you using the WSL?
So I'm stuck at WSL 1 for the moment
because WSL 2 does not support IPv6.
And that is absolutely required for the stuff that I do.
So, yeah, it's Windows, WSL1.
I do run VirtualBox for some local virtual machines.
And then my server room, all of my servers are various shades of Linux.
Okay, cool.
I like how you've got a server room.
I need a server room.
That sounds like a nice thing to have.
Well, as we head out, are there any tips you have for people listening who can start to be as involved in the Django community as you have been?
What would you say are good first steps for someone who's using Django but wants to get more involved?
Online, I'd say, obviously, I'm partial to the forum more so than the mailing lists.
I think I find the forum to be more personable, more personal, more personable than the mailing list.
Dengar users is a fine mailing list.
I still read it, but I was never really active on it because it just, for whatever reason,
that interface feels impersonal to me.
And so I very much appreciate the forum because it feels more community-like
than the mailing list ever did to me.
And it's like, please join the forum, browse some messages.
And if you've got something to say to chip in, answer a question, people don't bite.
You know, I remember my first couple of answers, there was a lot of trepidation.
It's like, well, if I answer this, who's going to jump on me and say, you're wrong, you're wrong.
That's pretty rare.
It didn't happen, you know.
I've been corrected enough times, but, you know, that's all part of the learning process.
There are a couple people that I won't name, but they've been very kind in pointing out when I've
made mistakes. You know, and for that, I am grateful. Well, I think one of the nice things
about the UI of the forum is that when you use the search functionality, if you type in a question,
it will pull up if it's already been asked and answered. Because I would say beyond
not looking very nice, my biggest issue with Google Groups is it's very hard to
surface past conversations. So there's 10, 20, 30 takes on the same thing. And the forum is nice to
have it in one more of one place. And it's easier to read through. And, you know, I think so similar
to Stack Overflow, there's sort of one place for certain questions around different topics.
I think that's helpful. So what about offline? What about offline? When when when we're all able
to meet in person? What would you recommend? I mean, obviously, attend a Django con and sounds
like, you know, put your hand up to volunteer or even the local Django meetups. Yeah, that's true.
Um, you know, it's, um, I actually, we, uh, had met a person individual at a Django con
three, four years ago, and we created a local Baltimore group, uh, to try and do some meetups.
unfortunately, that kind of faded away for a couple different reasons. Lack of a place to
meet being a big one. But, you know, it doesn't take much to actually try to form a local group.
If you can't find something local, it doesn't hurt to say, put out some flyers metaphorically,
You know, go online, meet up. What's it? Meetup.com that you can you can create local meetups or even show and tell in the forums.
Probably a place that you could say, hey, I'm looking to meet people in area X, Y, Z and try to find a local community.
And if there's not one close by, even see if there's one that you can get started.
But certainly there's a lot to be said for meeting in person.
You only need two of you, you know.
Well, that's what we had two of you in an open invite.
Rachel Calhoun on recently who works with Django Girls, and she was in Korea at the time.
And it was two or three people who wanted to study Python.
And that's, yeah, how they got started.
You just need a handful of people.
And often it's a Python thing because Django is obviously a subset.
So, you know, it's fine if it's a Python meetup.
In Boston, where I am, there's a lot of developers, so there's Python and Django, but usually
the Python one, you can start talking about Django there, too.
So anyways, I think we're at about an hour.
Thank you so much for taking the time to join us.
Yeah, super.
Congratulations again on the Malcolm Award.
Yeah, absolutely.
Thank you very much.
Are there any outgoing thoughts you want to share with anyone?
No, just thank you both very much for hosting me this morning.
This has been a pleasure.
will carlton it's always a joy to be able to talk with either one of you um looking forward to the
day when we can all meet in person yes yes perhaps 2022 now but hopefully fingers crossed
yeah virtual and then until um so um thank you ken um for everyone listening you can find us
at chat django on twitter and django chat.com for this and future episodes we'll see you all next
time join us next time bye