Pull random records using Django ORM.
Requirements
Python 3.10+
Django 4.2+
Installation
$ pip install django-random-queryset
Setup
Add RandomManager to desired model:
from django.db import models
from django_random_queryset import RandomManager
class Model(models.Model):
objects = RandomManager()
# ...
No database migrations are needed.
How to use it:
queryset = Model.objects.filter(field=value)
queryset.random() # to get one random record
queryset.random(5) # to get 5 random records
queryset.random(len(queryset)) # to get all random records
queryset.random().values() # to have access to other queryset methods
Release files for django-random-queryset 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_random_queryset-0.3.1.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_random_queryset-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.6 kB
Release files / django_random_queryset-0.3.1.tar.gz
| Download URL | django_random_queryset-0.3.1.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
278123c82c77ade1f16d5620ef26f1a1efda18b8c60cd70296d9025bbe357dfe
|
|
BLAKE2b-256 checksum How to use checksums |
154137c8713b41407089d4f2039b862101fce7f153315b94960aaaf0d9f9c8f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 30, 2026.
Transparency logRelease files / django_random_queryset-0.3.1-py3-none-any.whl
| Download URL | django_random_queryset-0.3.1-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06b3a24164ccf8f17c1aab4c7c88a4e024880bda0e3028a69aece283e6dcca17
|
|
BLAKE2b-256 checksum How to use checksums |
531d9a14ff25fc63dd5145367a1ef7b2927c47b256e66d5808f497619d245f93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 30, 2026.
Transparency log