AI-Assisted Contributions and Maintainer Load
Published October 26, 2026
This video features Paolo Melchiorre at DjangoCon US 2026 in Chicago, Illinois, USA.
My first larger contribution to Django started during the sprints at DjangoCon Europe 2017 in Florence, where I worked on exposing database-side RandomUUID generation for UUIDv4 in contrib.postgres, so for me this topic has a very personal history inside the project.
Since then the way Django handles UUID generation has evolved, and recent changes extended these functions beyond PostgreSQL while also adding support for UUIDv7, which brings time ordering and new possibilities for modern database schemas.
In this talk I show how these UUID functions work in Django today, how UUIDv4 and UUIDv7 differ in practice, and how Django can generate UUID values at the Python side or at the database side depending on the backend and the use case.
This talk is especially useful for developers who already know Django models and want to better understand how UUID generation fits into real applications, migrations and schema design, especially now that support is broader and more flexible than before.
This talk was presented by Paolo Melchiorre at DjangoCon US 2026 in Chicago, Illinois, USA
https://2026.djangocon.us/talks/the-django-uuid-story/
LINKS:
Follow Paolo Melchiorre 👇
On GitHub: https://github.com/pauloxnet
On Mastodon: https://fosstodon.org/@paulox
On X: https://x.com/pauloxnet
Website: https://www.paulox.net
Automatically transcribed, so expect mistakes in names and technical terms.
So hello everyone. It's it's great to be here on the stage at the end of the conference and telling you this story about Django UAD, but specifically my my part on this part of the story. So everything starts with the release of Django one point eight in 2015. At the time I was already using Django a lot and as a user of Django I was monitoring all the release because I was curious about new features. New thing is I was I wanted to use my personal project or my work project. And I found this new field that has been added in that version of Django. What got my attention was the fact that Postgres
has a specific data type for UID and the fact that the initial goal was to have an alternative for a primary key for how to field. But at that point I was not involved in developing any part of Django or contributing directly in Django. So my personal story started just after a bit of this release. But before going ahead Here am I. I'm Paolo Melchiore. I'm right now I'm independent consultant specifically with Python and Django. Two words, I'm working also in US. I'm the on the board of the DSF.
I'm a PSF file of I participate in the community in various ways this year, but recently I co-founded with Cartoon Gibson the Jung on the Band Sprint event. We're going to have the next one at the end of September in Pescara where I live. And I also founded with a couple of other Python developer the Python Pescara local meetup. And the story for me with UAD started very close to Pescara. At the time I was working with a company based in Rome. I took this picture in a concert in Rome in the Circo Massimo which is very in the center between the Coliseum and the Forum. And it was is a very great place if you want to
watch a rock event or a concert. And the project uh I started working on was a platform to share and collect all the concerts and events in Rome. But when I started working the projects I found this Very old project with very old version of Python, Django and Postgres, but still it has a lot of events on it. The two main problems have been the time that the search function was very slow, like like based, and that they exposed uh publicly the internal ID of every event. So the first point of this to this list I already talked about a lot because
I ended up using the full text search with Django and Postgres and I already wrote a lot about it and presented a talk called Suira Django Kong. And the second one instead is was my um high hook to do my very first pull request and my very first contribution. So what I did in my project was to try to use this new UAD field I found in the release note of Django. And for me it was important to have a unique UAD. But unfortunately we had already a lot of instance of our object in the database So to solve that problem I f I searched in the documentation of Django and I found out that it was already a guide
to guide you and to let you add a unique field in your existing model. It worked very well and the core part was this data migration and that was a way to set a new UID version 4 in all the UID model. But it it has uh some pain points and something that was um that needed some improvement. So that was my first moment that I realized that I was able to suggest something to improve the the documentation, the guides. The core part of my very free small contribution has been to only
to suggest to store again only the UID field and not to uh is in my case store ten or twenty different uh field again every time in in every cycle. But I'm a fan of this uh this quote from the Django uh documentation, the fact that you have to work at the proper level and in this case the proper level for me was uh the database level so generating the UAD at application level with Python was something that was not uh I felt was not the right thing to do. So since I was updating my project uh also at the database layer I was also reading about the release note
uh for Postgres and I read that in Postgres 9. 4 they added a database function to add um uh to generate UAD version 4 directly at the database layer. And I tried it directly in the database. It worked very well and I understood that maybe that was the right layer to update my model. So I created a custom database function. At the time was a bit more complicated than today. But it worked quite well. And I had updated my data migration instead of cycling all over
the models that I already had in my project, I was able to perform only one query. and updating every uh more every instance in one SQL query that was this one. And I wanted to have a proof of this improvement, so I did some very basic benchmark on my local computer at the time. And I found out that it worked very well, at least on my computer, only with 10,000 instances, and in production we had more than more than that. So this was something that confirmed me that the solution I found was interesting and maybe useful for other people.
At the time I was planning to participate in my ever first Django Con, that was DjangoCon Europe in 2017 in Florence. And I was excited to be part of this conference and also to participate today's sprints after the conference. So I tried to uh uh create a generate and put everything I found during the previous uh months in a US in an issue in the in the tracker. I collected all the information I had, also the benchmark, the code uh snippets. And before going at the sprints, I already had everything in mind and ready to propose this new issue.
to the people at the at the sprint. In fact, I asked help for mentoring for delivering this this functionality to Marcus and Mark that helped me A lot in polishing the code I prepare, the mentoring me in the flow, opening an issue, setting all the flags that you have to set is not immediately if you never did it and also helped me in updating the documentation part of the pull request all this part that you need to do before being able to merge it And during the the sprint I was able to complete all these fix this improvement And as a traditional for the Django
Django Kong Europe, I played the gong. This is a tradition from the Django under the hoods. And we are still searching this gong Maybe we'll have in the next DjangoCon Europe, but at the time we had and I was able to play and take this picture. So other people uh reviewed my pull request and in a couple of weeks they merged it and was very uh exciting for me. That was my uh very first not not trivial pull request that has been merged in Django. So after that moment other people were able to use this database function directly to update in only one SQL query if they were using Postgres of course. And after six months from the sprints, Django 2.
0 has been released with this function function on it. But I had to do some research in all the tickets because the story of UID is not starting with me. Other people tried in the past to have it in Django. And the first issue I ever I found is this one from 19 years ago. This has been the first uh proposal to add a UAD field in the core Django. If you go there and read the comments you will find that people say that that was not useful for Django and they close it as a one fix. But after five years at the moment , another issue very similar to that has been open.
And at the moment Mark Tamil was working also a lot in the Postgres. And was the one that opened the pull request to add this the functionality. And Mark has been also the the one that helped me in the sprints to uh emerging my pull request. But this one is an older one, is the 21 years ago years old issue. and is important for this story because uh adding the database uh the default from the database is something that uh all the people asked for a long time. And during the sprint of DjangoCon
Europe 2022 in Porto , Lily started working on this again. She rebase from a previous pull request from three years before and after a long of conversation as you can see uh here in the screenshot the functionality has been merged It is important has been merged in Django 5. 0. It is important for this story because it completed the The goal I had in mind since the beginning. At that point I was able to use my custom random UAD function as a default for a UAD field. And to let the database generate for every new instance
a primary key with an UID directly at the database layer without any default at the Python layer. And in fact, this is the SQL query you can see if you perform it in Postgres. So after this pull request, I continue contributing in Django in different ways in different field. I get more interested in full-text search and other things, but still I was curious about new feature about uh the new feature of Django, new feature of Python. And last year I was monitoring the release of Python 3. 14 and the thing I found that they added support for different version of UAD.
I was in particular interested in UAD version 7, but they also improved the performance of the generating of this. uh this UAD. So I downloaded a um a version of uh uh of Python that was not already released. And I tried it locally and I checked the fact that the UAD version seven as a part of time-based part. So it there is a a timestamp part on it that you can extract And directly with the Python using only Python standard library you can extract a date time from the generated UID version 7.
More or less in the same period I was here, the same this very same conference, Django Con 2025. I was uh chat with Elizabeth at the Postgres boot as she shared me the news about Postgres 18 and one of the news I found was that they had it uh the UAD version 7 generation directly in Postgres 18. So I get curious I tested it locally they had the new uh function a new name for the generated function instead of having the random UAD generation uh they had the the the UAD version 4 and the UAD version 7 and As in Python, they had the database function also to extract directly from the UAD version 7
the data time part from the timestamp of this UAD. This picture is from Django on the Mad 2025 that happened just before I was experimenting with these two uh new new new things and has been a the occasion for me to share about what I found about Carto and Lily share with us whole uh during the the days of the sprints about the new feature repository that other people already talked about also currently this morning. and it was very interesting for us to understand how the street council were working and they were asking for the community to have suggestion for new new features
During the the sprints we had a lot of chat working on different different uh feature issue and I remember working with Simon and Lily about the new UAD version 7 support in Postgres and proposing to them to add this new function directly in in Postgres, then the Postgres conship module At the beginning they were not sure, but at the end of the chat, the idea was to instead of adding only for Postgres, to research a bit if the support was already was evolved. in the last year also for other database and really open this issue in the new feature repository that we learned uh
just uh that they so she proposed to add support for UAD four and UAD seven which are the most used and useful in all the database and not only on the Postgres one. I continued experimenting with this uh stack and I wanted Since the proposal was only on the new feature repository, I experimented directly with Django 5. 2. I try to see the differences between the implementation and the support in SQLite and Postgres. In SQLite, I I was able already uh I was able already to uh store uh UAD version 7 directly in
a UAD field and also to extract at the Python level. the date time from uh the part of UID uh that is a timestamp. Unfortunately SQLite does have a specific data type for it at the horem it generator char data type But it it supports it if you want to store a UAD version 7 on it. Of course the SQL that you generate. put the value directly in the SQL query because it's generated at Python level. But with the property I was able to extract the the time directly from the UID.
I was more interested. I was more interested in Postgres of course. And to experiment with it as I I did. uh nine here before eight year before I created uh locally two database functions two custom database functions the first one was to use the um generation of USD version 7 and the second one was to extract the time from the timestamp part of the UAD. Since I spoke a lot about generated field and uh and I wrote article about it I used a generated field to experiment with the second one or the second function. So I created an item which the def the database default was uh U
Edd version 7 and another field that was automatically generated from the previous one and with the database function I was able to extract at the database database layer the the the time from it. This is the SQL query that you uh will find if you generate with Postgres. And if you try it locally you will find that in the difference between this code and the code we generated with Segur Lite is the fact that there is no The values come from the default and the query returns you directly two generated information.
The UAD and the part that is extracted from the UID. If you have only to read it is not so different from what you had already in SQLite, but having an additional column you can do something like that. You can use directly the date time from the UAD and perform some filter on it, some query maybe you can use in the admin hierarchy filter or you can have other ideas to use it in various ways. The day after I published my article, Lily opened a pull request to add the support. in the whole database and after just I think months
Jacob merged it after a bit of review and Lily put the jung on the med label on it because everything started on during that the sprints. And now in Django 6. 1 everyone can use this new two function to generate the version of UID you need in your project. And you can use it as a database default not only in Postgres, like I experimented in my article in Django uh using Django 5. 2, but in Django 6. 1 you can use also in different type of database. The support is not the same for every database. If you are using a very recent version of Postgres or MariaDB, you can have both the data type, you can generate
both functions, both version of UID. In SQLite it depends from the version of Python you are using. In Oracle, it's very complicated to understand which version they are using. And for example, I put there a note because you can have the UID generated function but it cannot work as a database default you have to check the version properly and it seems that MySQL don't care about. about UAD because they don't support at all UAD, not for the data type or for the generation. So I as we said speaking of UAD we have different layer of uh supporting hits.
We can still store every type of data type of UAD in the UAD field. But a different database backend can use different data type for it, for storing it. And you can have or cannot have, independent from the database, the database function to generate it. And in it depends also if you can use the db default or the default at the Python layer. So the story is is very long, it started in 2007. 20 years ago and for me I've been part of it for a short part of the story but it's been interesting because everything started in this moment
when I uh uh propose to add something on Django and people helped me in a sprint to do that. With uh without them I was not able to create the perfect pull request. So from this point I get all the the feedback and I was sure that I was able to do something like that. I continued contributing on it. So it continued for years and in this other step of the history I n was not the one that created the pull request but I tried to share the ideas and other people contributed it What I'm saying to to say to you is that
contributing and being part of Sprint is important. For me has been the uh has been very important in my career. It changed everything. It was the way that I get involved. And I suggest you to to do the same. It's a perfect moment to ask for help. to experiment something and to contribute back to Django. So I invite you everyone to tomorrow to join the Django Con US Sprint. and to to think about something you like or a new feature you want to experiment or maybe something that you already uh prepared or worked on in the past in the past month. So thanks to the organizer also to organize the sprint and also the volunteer speakers and sponsor
If you want to, you can read this uh this slide because I'm sharing on my my website And I'm sure you all are very, very curious to know what is the picture I used for the wall slides It's a picture I took in the northern Italy in Sutirol, in Alto Adige. And you have the opportunity to see this mountain very close because The next edition of DjangoCon Europe will be very close to where I've been this year. It will be in Innsbruck in Austria in February. This is a picture that Jacob sent to me from Innsbruck. This is what I look like in the winter. You can go there skiing. So
we already have a landing page for DjangoCon Europe. I'm not part of the organization, but I'm here as a European to promote and to invite you all. to join Django Kong DjangoCon Europe. If you have any question you can write directly to me and ask questions about DjangoCon Europe, Django Demand and similar things or UUAD. Thanks, everyone.
August 24 - 28, 2026
Chicago, Illinois, USA
Note: 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 October 26, 2026
Published October 26, 2026
Published October 26, 2026
Published October 26, 2026
Published October 26, 2026
Published October 26, 2026