Skip to main content

Extensions for Django MongoDB Backend

Project description

django-mongodb-extensions

Extensions for Django MongoDB Backend

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

License

See LICENSE file for details.

Project 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.2.0.tar.gz (20.5 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.2.0-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_mongodb_extensions-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f31c9fbfc0e8e32c0f47b8c10db825ccd2428146fc43c9a9c740b730c0de924a
MD5 5190f73d32359757f4e671216a96aca7
BLAKE2b-256 572c5348e664e38e45dc4aff242e89d7d0ceb2f24b53812da694ec35d1e0c508

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_mongodb_extensions-0.2.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.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_mongodb_extensions-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ac4d8a287efc9a26d39e3190f7cc3a1d6f9339a0232b918bec400d5237ec93c
MD5 0a17f516983472ad8222d4c530a1c059
BLAKE2b-256 39debab54bad00202a5b888b6677de43a6666a71c013952f5b4d4a942ea4d3a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_mongodb_extensions-0.2.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