Skip to main content

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)

Source distribution for django-random-queryset 0.3.1
File Size Uploaded
django_random_queryset-0.3.1.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-random-queryset 0.3.1
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.2.0

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page