Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dizballanze/django-eraserhead
💂🏻 Django package that provides hints to optimize database usage by deferring unused fields (and more)
https://github.com/dizballanze/django-eraserhead
django django-models django-orm monkey-patching
Last synced: 4 days ago
JSON representation
💂🏻 Django package that provides hints to optimize database usage by deferring unused fields (and more)
- Host: GitHub
- URL: https://github.com/dizballanze/django-eraserhead
- Owner: dizballanze
- License: mit
- Created: 2017-07-08T14:07:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-26T20:27:56.000Z (about 2 years ago)
- Last Synced: 2025-01-15T01:21:43.321Z (11 days ago)
- Topics: django, django-models, django-orm, monkey-patching
- Language: Python
- Homepage:
- Size: 230 KB
- Stars: 196
- Watchers: 9
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- starred-awesome - django-eraserhead - 💂🏻 Django package that provides hints to optimize database usage by deferring unused fields (and more) (Python)
README
=============================
Django Eraserhead
=============================.. image:: https://badge.fury.io/py/django-eraserhead.svg
:target: https://badge.fury.io/py/django-eraserhead.. image:: https://travis-ci.org/dizballanze/django-eraserhead.svg?branch=master
:target: https://travis-ci.org/dizballanze/django-eraserhead.. image:: https://codecov.io/gh/dizballanze/django-eraserhead/branch/master/graph/badge.svg
:target: https://codecov.io/gh/dizballanze/django-eraserhead.. image:: https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg
:target: https://saythanks.io/to/dizballanzeProvide hints to optimize database usage by deferring unused fields
.. image:: https://github.com/dizballanze/django-eraserhead/raw/master/eraserhead.jpg
*WARNING* use this package only in dev environment!
Documentation
-------------Requirements
-----------* Django 1.9+
* Python 2.7, 3.4+Quickstart
----------Install Django Eraserhead::
pip install django-eraserhead
Add it to your `INSTALLED_APPS`:
.. code-block:: python
INSTALLED_APPS = (
...
'eraserhead.apps.EraserheadConfig',
...
)ERASERHEAD_ENABLED = True
ERASERHEAD_TRACEBACK_BASE_PATH = BASE_DIRSettings:
* `ERASERHEAD_ENABLED` - enable/disable Django Eraserhead
* `ERASERHEAD_TRACEBACK_BASE_PATH` - set base path to filter tracebacks. Set to `None` to display full traceback.Features
--------.. image:: https://github.com/dizballanze/django-eraserhead/raw/master/screenshot.png
Django Eraserhead monitors:
* querysets/models fields usage (used and unused fields) with considering deferred fields
* count of instances created for each queryset
* corresponding model of each queryset
* traceback for each queryset to easily find corresponding code
* calculate memory consumption of unused fieldsBased on fields usage Django Eraserhead suggests optimizations for each queryset.
TODO
-----* decorator and/or context processor for partial stats collecting
* detect deferred fields loading
* auto deferring fields based on usage
* display deferred fieldsRunning Tests
-------------::
source /bin/activate
(myenv) $ pip install tox
(myenv) $ toxCredits
-------Tools used in rendering this package:
* Cookiecutter_
* `cookiecutter-djangopackage`_.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage