pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/elinaldosoft/ddquery

ous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-643d7793beaaba0b.css" /> GitHub - elinaldosoft/ddquery: Django Debug Query (ddquery) beautiful colored SQL statements for logging · GitHub
Skip to content

elinaldosoft/ddquery

Repository files navigation

Django Debug Query (ddquery)

Ddquery is a library built in python that add color in your SQL statements and show in your command shell (pretty), for relational databases that uses ORM of the Django

Requirements

  • Python ≥ 3.3
  • Django ≥ 1.8

How to use

pip install ddquery

Add it to your Django Logging settings

You can add it to your Django LOGGING settings:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'sqlhandler': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'sqlformatter'
        }
    },
    'formatters': {
        'sqlformatter': {
            '()': 'ddquery.SqlFormatter',
            'format': '%(levelname)s %(message)s',
        },
    },
    'loggers': {
        'django.db.backends': {
            'handlers': ['sqlhandler'],
            'level': 'DEBUG',
        },
    }
}

Configuration options

'formatters': {
    'sqlformatter': {
        '()': 'sqlformatter.SqlFormatter',
        'format': '%(levelname)s %(message)s',
        'reindent': False,
        'highlight': False,
        'keyword_case': 'lower'
    },
},

How it looks like?

python manage.py runserver

Shell

python manage.py shell

Shell 02

python manage.py migration

Migration

References

About

Django Debug Query (ddquery) beautiful colored SQL statements for logging

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy