Skip to main content

A simple Django app to store N+1 Queries on django views.

Project description

Repeat Queries

Smart Queries is a django package which helps django developer to avoid the N+1 queries issue by recording it and keeping a track of it per request.

Quick start


  1. Add "repeat_queries" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [
        ...
        'repeat_queries',
    ]
    
  2. Add 'repeat_queries.middleware.DuplicateQueryMiddleware', to your MIDDLEWARE settings like this ::

    MIDDLEWARE = [
        ...,
        'repeat_queries.middleware.DuplicateQueryMiddleware',
    ]
    
  3. Include the repeat_queries URLconf in your project urls.py like this:: For Django version > 2.0

    path('repeat_queries/', include('repeat_queries.urls')),
    

    For earlier versions

    url(r'^repeat_queries/', include('repeat_queries.urls')),
    
  4. Run python manage.py migrate to create the repeat_queries models.

  5. Start the development server, Hit any endpoint/view and visit http://127.0.0.1:8000/admin/ to see your data.

Contributing

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
  2. Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).
  3. Write a test which shows that the bug was fixed or that the feature works as expected.
  4. Send a pull request and bug the maintainer until it gets merged and published. :)

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

smart-queries-0.7.tar.gz (11.3 kB view details)

Uploaded Source

File details

Details for the file smart-queries-0.7.tar.gz.

File metadata

  • Download URL: smart-queries-0.7.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.14

File hashes

Hashes for smart-queries-0.7.tar.gz
Algorithm Hash digest
SHA256 30d2341e7491be479e2c850acd3187c1d3bec0dbb42112c60251773535675e12
MD5 8e09ab16f3ded2437099a36ad55b1b3c
BLAKE2b-256 a53e3d64ef947168a5ec2e4e2360ff969cfb7d28552e778bbba20c9dc116fca2

See more details on using hashes here.

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