Registry / devops / django-etc

django-etc

JSON →
library1.4.0pypypi✓ verified 81d ago

A collection of tiny, reusable utilities for Django that don't warrant their own apps. Current version 1.4.0, maintenance mode with infrequent releases.

pip install django-etc
INSTALL
IMPORT
SIG · DJANGO-ETC
D
django-etc
devopspythonv1.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VERSION
from etc import VERSION
from etc.views import BaseView

Basic usage of utility functions and BaseView class.

from etc import get_val_from_dict my_dict = {'key': 'value'} result = get_val_from_dict(my_dict, 'key', default='not found') print(result) from etc.views import BaseView from django.http import HttpResponse class MyView(BaseView): def get(self, request): return HttpResponse('Hello')
Debug
Known issues
gotchaImport as 'etc', not 'django_etc'. Despite the PyPI name being 'django-etc', the top-level Python package is 'etc'. This is a common source of ImportError.
fix
Use 'from etc import ...' instead of 'from django_etc import ...'
affects: all
gotchaMany utility functions (e.g., get_unique, get_val_from_dict) are directly under 'etc', not in submodules like 'etc.utils' or 'etc.helpers'. Checking documentation or source is required.
fix
Import directly: 'from etc import get_unique' instead of 'from etc.utils import get_unique'.
affects: all
deprecatedThe function 'get_val_from_dict' is considered legacy; prefer using Python's built-in dict.get() or collections.ChainMap.
fix
Replace with my_dict.get('key', default).
affects: >=1.4.0
Upgrade
Version history
1.4.0latest on PyPI · released Oct 6, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Resources
django-etc — pip install django-etc · libregistry