How to use UUIDv7 in Python, Django and PostgreSQL

Hi everyone,
I’ve just published a detailed article on using UUIDv7 across Python 3.14, Django 5.2 and PostgreSQL 18, including examples with db_default, GeneratedField, native PostgreSQL functions and a note on UUIDv47 for safer public identifiers.

You can read it here:
:backhand_index_pointing_right: https://www.paulox.net/2025/11/14/how-to-use-uuidv7-in-python-django-and-postgresql/

1 Like

I can’t understand - what you want say - here

  • SQLite or non PostgreSQL databases are used

and that

Use PostgreSQL uuidv7 when:

SQLite can this. too

  • the database is responsible for generating identifiers
  • multiple writers insert rows concurrently
  • you want to expose creation time using uuid_extract_timestamp
  • sequential inserts improve performance

Why not

non PostgreSQL

1 Like

Thanks for your feedback. I’ll update the article to clearer. And update you here.

In the basic set Python from 3.12 we can see uuid4.
In which the python’s version we will can see the uuid7? :slight_smile:

Python 3.14: as I wrote in my original post and in the article. But if it’s not too clear I can add a clarification.

Thanks/ All fne. now

1 Like

I’ve just updated the article with several clarifications and an additional section based on the feedback received yesterday. Thanks to everyone who contributed suggestions!