Skip to main content

django-mongodb-extensions

Extensions for Django MongoDB Backend

Documentation

Version Support

Django / Django MongoDB Backend Django Debug Toolbar Django REST Framework
5.2 ≥5.1 ≥3.16
6.0 ≥6.2 ≥3.17

Django version support follows Django's supported versions policy.

Installation

pip install django-mongodb-extensions

Extensions

MQL Panel

This panel for Django Debug Toolbar provides insights into MongoDB queries executed during a request similar to how the SQL panel works for relational databases.

Features:

  • View all MongoDB queries (MQL) executed during a request
  • See query execution time and identify slow queries
  • Re-execute read operations (aggregate) directly from the toolbar
  • Explain query execution plans
  • Color-coded query grouping for easy identification
  • Detailed query statistics and performance metrics

Configure the MQL Panel

First, install and configure Django Debug Toolbar by following their installation instructions.

  1. Add to INSTALLED_APPS in your Django settings:
INSTALLED_APPS = [
    # ...
    "django_mongodb_extensions",
    # ...
]
  1. Add the MQL Panel to your debug toolbar configuration:
DEBUG_TOOLBAR_PANELS = [
    "debug_toolbar.panels.history.HistoryPanel",
    "debug_toolbar.panels.versions.VersionsPanel",
    "debug_toolbar.panels.timer.TimerPanel",
    "debug_toolbar.panels.settings.SettingsPanel",
    "debug_toolbar.panels.headers.HeadersPanel",
    "debug_toolbar.panels.request.RequestPanel",
    # Add this:
    "django_mongodb_extensions.mql_panel.MQLPanel",
    "debug_toolbar.panels.templates.TemplatesPanel",
    "debug_toolbar.panels.staticfiles.StaticFilesPanel",
    "debug_toolbar.panels.cache.CachePanel",
    "debug_toolbar.panels.signals.SignalsPanel",
    "debug_toolbar.panels.redirects.RedirectsPanel",
    "debug_toolbar.panels.profiling.ProfilingPanel",
]
  1. Optional: Configure settings.
# Maximum number of documents to return when re-executing select
# queries (default is 100).
DJDT_MQL_MAX_QUERY_RESULTS = 25

# Queries slower than this threshold (in milliseconds) are highlighted
# in the debug toolbar (default is 500 ms).
DJDT_MQL_WARNING_THRESHOLD = 1000

Django REST Framework

Serializer support for Django MongoDB Backend models through django_mongodb_extensions.rest_framework. See the documentation for details.

License

See LICENSE file for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_mongodb_extensions-0.3.0.tar.gz (32.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_mongodb_extensions-0.3.0-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file django_mongodb_extensions-0.3.0.tar.gz.

File metadata

File hashes

Hashes for django_mongodb_extensions-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c675ceaddaea0e597c5bbe3971289641f6355c0a9c19839e0415caa1b8ca481d
MD5 4c8251a034564d87597cd3417857ced5
BLAKE2b-256 91b774446d7eb195e616bc04bed23e515a689e89a29a76c2eca6fcb78cf192dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_mongodb_extensions-0.3.0.tar.gz:

Publisher: release-python.yml on mongodb-labs/django-mongodb-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_mongodb_extensions-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_mongodb_extensions-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79208571c7d9582359451d65c0a2d8c32acffaf0adb3e5bbac987c50e851d226
MD5 cf80b38e49145b0a850a8aea4ae0b99d
BLAKE2b-256 69fdf32e1fbb08daa961c633c5741791a3508f3750cbd1c8326fe9b26513f965

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_mongodb_extensions-0.3.0-py3-none-any.whl:

Publisher: release-python.yml on mongodb-labs/django-mongodb-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page