Creating an Inclusive Django Community with Kenya Phelps
Published July 15, 2026
This video features Ilerioluwakiiye Abolade at DjangoCon US 2024 in Durham, North Carolina, USA.
When you write a Python script that has dependencies, the standard has always been to use a separate file like requirements.txt or pyproject.toml (using Tom’s Obvious, Minimal Language format) for handling the dependencies from external libraries. To share these scripts that are dependent on external libraries or other versions of Python, the process becomes more complex since the receiver has no choice but to create a new virtual environment with all the necessary dependencies. It becomes even more cumbersome in educational settings or among collaborators, where people might have different levels of Python expertise.
With the introduction of PEP 723, we’ve brought simplicity to our code, as we can now embed dependencies directly in a single file script. In this talk, we will explore this new method that enhances our productivity by making it easier to share, deploy, and work with Python scripts, making working with Django closer to being seamless.
This talk was presented at: https://2024.djangocon.us/talks/the-magic-of-dependencies-installing-themselves/
LINKS:
Follow Ilerioluwakiiye Abolade 👇
On X: https://x.com/llerioluwakiiye
Follow DjangoCon US 👇
https://fosstodon.org/@djangocon
https://x.com/djangocon
Follow DEFNA 👇
https://www.defna.org/
Video production by the presenter and DjangoCon US 2024 volunteers.
PEP 723 lets Python scripts declare their dependencies and related metadata in an inline TOML block, so the information needed to run a script can travel with the script instead of in a separate requirements file. Ilerioluwakiiye Abolade demonstrates declaring Rich and importing it, then argues that inline metadata can make small scripts easier to share and new developers easier to onboard, including in Django workflows. She recommends pinning versions where practical, keeping the dependency list lean, documenting why dependencies are needed, reviewing changes in version control, and testing across environments.
Summarised automatically from the transcript.
Automatically transcribed, so expect mistakes in names and technical terms.
Um, before we start today, I would like us to quickly do something Let's imagine this. We are in the kitchen by two a. m. in the middle of what we call the disaster zone of Flour, sugar, eggs, and all. You're really hungry and you're trying to recreate your grandma's pure right cookie recipe. And it's going bad because there is one problem. Your grandma actually did not have a cookie recipe. She just used to say it all comes from the feel and just mix the recipe with the ingredients. Yes, so you're trying to channel your inner grammar and like recreate these cookies, but it's not going well at all. The first time you try You are not sure whether your cookies are undercooked, overcooked, or probably even both.
The second time you try, it is too born to even be eaten by an ant. The third time you try, you're really considering calling the fire emergency department because of how bad and how disastrous it was So before you give up, you get a message on your phone. It's a message from your cousin, so you open it. She actually sends your grandma's cooking recipe. Yes, so she sends it and you decide to okay try one last time before giving up. And something surprising happened. Just after you tried this one time, you have your grammar perfect. Cookie recipe. You might want to ask me, we are doing Django today, we are cooling, we are doing all of that.
So how does cookies have to do with How does cookies have to do with what we are doing here today? Well, let me put it this way: the story of every developer before the introduction of the Python announcements proposal 7 to 3 was your story before your cousin sent you the cookie recipe. Before all developers used to struggle with Dependencies installation. I feel we've all been there one time or the other when we want to install a particular dependency. I 'm having problems of Okay, this version doesn't work with what you're doing here today, or this version of this um of this package doesn't work with this version of this package, and it's usually chaotic, it's usually a mess.
But yes, after the introduction of this Python and Aspen Proposal 73 This is very avoidable. As developers, we do not have to face these problems anymore today. These problems can now be solved with the introduction of the Python announcement proposal 723, which we are gonna be speaking. about today. The magic of dependencies installing themselves. I am more than honored to be in front of a lot of amazing people here today and I'm really excited for this opportunity I'm grateful for Django Korn US this year particularly for allowing me to be a part of this um of this event. My name is Lirelowaki Abolade.
Um, and who am I? I'm a mechatronics engineering student. I'm also a machine learning and AI enthusiast. So if you're not catching me doing mechatronics, You're catching me doing um machine learning and AI stuff. I'm also experienced in software engineering. I've worked with Python, JavaScript, and frameworks, including Django. And I'm very good feeling I'm a good feeling person. Yeah. I consider myself to be quite passionate at at everything I I do Today, we are going to be speaking about a number of things, not a lot, but enough to change our lives. And I'm not kidding. We are going to be speaking about the inline script metadata. We're also going to be speaking about why you should choose this method.
We are going to run through a demo of like magically installing our dependencies. We're going to look at the best practices to go about it. We're now going to like streamline it into our workflow as Django users, then we're going to move to the conclusion today So now why we are here today the inline script metadata Once you're ready for this is the recipe card for your code. Just the same way your cookies were going burnt before you got a recipe from your cousin and after you got one it just worked immediately it's the same way this is going to work for your code you might have had issues with like dependencies installation and a lot more There might not be a lot, but they could be bothering.
And for people like me, there could be a lot. Yeah. So this could like really change your workflow for the better. So this is a way to specify script-related metadata directly within your Python files. So with this recipe card for your code, You don't have to include the requirement. txt file. You can easily just have the dependencies you want to install directly within your Python files as they come in. So you're running it without even Knowing that you're running it. Well, rubbish. Start again. This is a way to specify script-related metadata directly within Python files. So with this new recipe card for your code, you literally can just put your dependencies within your Python files.
Now what you're running is you're not going running through the extra stress of running your requirements. txt file or your Pyproject. coml file, but you're just running your normal Python file. And in that sense, you're installing the dependencies you need It is placed at the top of your Python file. So this ensures the readability of your code. When you enter your code, you could easily just see the dependencies you need, see the um versions you need and easily run your Python file. This way you don't have to like go through the extra stress of running your requirement or TX file, making sure your dependency versions Correlates, making sure these dependencies run well with your code and all that problems.
So this literally solves the major problems of dependencies for us So uses TOML formats for easy reading and writing. Yeah. And you can easily write it. This is why this method is actually adopted for this. So um this my points here are just to like explain why this is like a perfect recipe card for your code, why you should use it and how it is used within your code So the basic syntax of how this works is um this way I have highlighted her booth here. It works with commenting out your scripts, um, writing your key value
pairs, where your key and value here will be like the dependency, then the value will be the dependency and the version that the dependency is. And another queue, let's say there are other requirements available, would be the list of like the requirements necessary and all. I 'm going to look at look at a more detailed version um in our Toute D so Moving forward, why should you choose this? I've explained um the recipe card for our code, how it works. why she is it and all of that. So why should we choose this Python enhancement proposal
723 which deals with the magic of dependencies installing themselves So one is improved dependency management. So you can actually share the exact versions directly in the script. So instead of um running maybe um a dependency you need And um finding it hard to place the version that you might want to use, you can specify the exact versions you need directly in the script. So to run this code, you need this version of this dependency. That way you don't have dependency problems. You don't even have the versioning problems. So also it enhances your the readability of the dependencies now
of your code generally. So this way All requirements for your code is like visible. Immediately you open your Python file, you're seeing all the dependencies, all you need at once. This way. your code is like way more readable than normal and it usually is rather yes I think this is one of the points that stands out for me the most is how easily shareable the files become so you don't have to share an additional requirement. txt file especially to like newbies You can just share your code and they are running it, not having problems with dependencies, not having problems with the versioning and anything like that. I think this point stood out for me the most
because it helped me in my own particular workflow. Also, um my last point here is the management command You can specify Django version and other dependencies. I've said this on and again about how you can just specify the versions, the dependencies, and all that you need in your code. So I feel like all these reasons are reasons enough to use this Python enhancement proposal 73 Now we are going to move into the demo of how we can install our dependencies using this PEP723 method that makes our life way easier
So how it works how it works here. Um this is a simple running This is a simple code rather of me running um running my code using this PEP73. So here I have my um Script written the same way I wrote the basic syntax. So I have a written here. It's a script, then there's a dependencies key. Then I specified reach So which is just to like color our out practically. Yeah, so with this um Python announcements proposal 73, I didn't have to import Rich separately.
I just imported it after running my PEP 73 and then this worked. Um Okay, quite hard to see, but yes, this worked. And this is blue here. So right here. I found this very quite interesting that you didn't have to literally do anything. You were in your your I'm in my code. I'm just running a script. Dependencies across the ridge and easily I was able to import a dependency and um use it into my workflow. The best practices for this is one be very specific Use exact versions when possible.
The reach there, I didn't specify the version, but yes, that works. But yes, using exact versions when possible, we will make our code Way cleaner and it's make everything less chaotic. So using exact versions when possible saves a lot of stress, especially when you are sharing your code to new people in the in in your workplace rather so keeping it lean only including necessary dependencies I think one problem people tend to make when using this PEP73 is okay I'm using the dependency Um I don't I don't need it anymore, but I'm not clearing it off. I think it's something we tend to overlook because
you're just like adding more dependencies to the top of your script and running your code and since it's running fine it's like hard to just go back and remove the dependencies you don't need anymore Um but yes, only including necessary dependencies makes it run way smoother and makes your code way cleaner. So updating regularly, review and update metadata as your project evolves. Yes, as your project evolves, you should go back to it, change the versions when necessary Um the point of using this Python enhancement proposal is to make sure there are no problems with your versioning, no problems with your dependencies so going back to review and update your metadata the project involv evolves will make
this like really perfect So commenting, explaining why certain versions or dependencies are required really helps a lot. So the dependencies tend to be really vague. Like you don't really see their importance in your code until you look into it very deeply. Until you look into it very deeply. So it is just easier to comment okay I'm using rich to color this in my output I'm using Django for this, I'm using this for this. Makes it way easier to read if nothing else. Version control. So yes, as you change your metadata, it it is really good to like um commit changes um okay I changed my metadata I I included this version I included this dependency
I changed the version of this dependency from this to this Um that makes that makes it really easy to follow through your comments. So testing. Verifying that your metadata works in different environments really makes a big difference. So not just running everything and saying, oh, it works on my laptop, but actually testing it on different devil mix makes it makes it more than like guarantees that okay when you send your code to any when you share your code to anybody it will easily run on theirs too So we are going to be moving to the Python enhancement proposal 73 for Django users. We are just going to go through some challenges and some solutions that this has actually brought.
for Django users now. So the challenges with the traditional Django dependency management are the first point here is environment mismatch. Developers working on different environments usually struggle with dependency conflicts. So you um errors like This dependency version doesn't go with this dependency version. Um usually arises um more than once In the workflow of a developer. So, yes, this environment mismatch is one of the challenges that um developers usually struggle with. Another being sharing of scripts. So she already started low script or management commands usually requires
additional setup. So you usually need to um one first like go through your requirement. txt file And import all the dependencies you need and start struggling with the versioning and a lot of things like that, or the Pi project the TOML file, and um installing things like that before actually coming into your code. So now another problem is onbody new developers. I'm trying to imagine how much of an headache it would be. Coming in as a new developer and taking time firstly to like set up your dependencies before actually going into your code. So I feel like this is something that can be easily avoided, which is why Pep
seventy three came into the lives of Django users Now we can have seamless sharing, environment consistency, simplified onboarding. In that you could easily share your scripts now. And not think that okay the person will actually spend time running dependencies or or stuff like that. You could just go straight into your code. Um another is the environment consistency. So this same script, since it's the same exact script you're running, it is guaranteed that okay every single time you run it, it is definitely going to run. And new developers can now get started quickly by just running the code directly, not bothering about dependencies, forgetting that they even exist maybe, and um
going straight into the code. So now to our conclusion, I have four points I want us to take note of before we Close the talk for today. The first one being the need to start using this in your personal projects. I spoken about the advantages. The problems is solving, a lot of things like that. So I feel like actually using it in your projects makes a lot of difference. Honestly, it works like magic. So using it in your personal projects makes a lot of difference. Advocating for their use in your workplace makes a lot of difference too because you're making it easy for you to share scripts, you to onboard new developers and for the um
for your workplace to focus more on the actual problems than problems are trivial like this um contributing to open source Django projects using this also will make more people like um adopt this practice which makes a lot of difference. So staying updated, staying updated to know okay, this has changed. This is not how PEP seventy three works anymore. This is what the new things has come to play is what's actually brings um makes our coding workflow the best So thank you so much for listening to me today. Once again, I'm super
grateful to be here and I um pain that I cannot attend physically because I actually want to be there physically. If you have any questions, feel free to reach out to me via my mail, my Twitter, and my LinkedIn Um thank you so much for listening once again.
PEP 723 lets you add script metadata, including dependencies and their versions, directly in a Python file using a TOML-formatted block near the top. This means the script can carry the dependency information it needs instead of relying on a separate requirements file.
Discussed at 5:06It makes dependency versions visible alongside the code, simplifies sharing scripts, and can reduce version conflicts and setup steps for people running them.
Discussed at 8:15Add a dependencies entry to the script metadata, then run the script with a tool that supports PEP 723. In the demo, the speaker declares Rich and then imports and uses it without installing it separately first.
Discussed at 10:33Use exact versions when possible, include only dependencies the script actually needs, and review the metadata as the project changes. The speaker also recommends explaining dependencies with comments, tracking metadata changes in version control, and testing in different environments.
Discussed at 12:04It can make Django scripts and management commands easier to share, reduce environment mismatches, and help new developers get started without separately setting up dependencies first.
Discussed at 15:06Note: We understand that names change, people change, and bodies change. We respect each individual's journey and privacy. If you have any concerns about a video or need us to remove content, please don't hesitate to contact us. We will handle your request with care and promptly address any issues.
Published July 15, 2026
Published July 15, 2026
Published July 15, 2026
Published July 15, 2026
Published July 15, 2026
Published July 14, 2026