Skip to main content

Collection of small utilities for Django and Django REST framework projects

Project description

django-jutil

Collection of small utilities for Django and Django REST framework projects.

Features

  • Simplified admin changes history logging (admin_log)

  • ModelAdmin with length limited history view (ModelAdminBase)

  • Extended admin log mixin of changed fields (AdminLogEntryMixin)

  • Admin file download mixin with file permission checks (AdminFileDownloadMixin)

  • User authentication helpers (require_auth, AuthUserMixin)

  • Mixin for cached model fields management (CachedFieldsMixin)

  • BaseCommand extension which catches, logs and emails errors (SafeCommand)

  • Command options for simplified handling of date ranges (add_date_range_arguments, parse_date_range_arguments)

  • Various utilities for date ranges generation and iteration (dates.py)

  • Utilities for dict sorting and formatting, choices list label fetching (dict.py)

  • Simplified email sending via SendGrid API (send_email)

  • Various formatting utilities (e.g. XML, timedelta, Decimal)

  • Decimal encoder for encoding JSON objects/dictionaries containing Decimal instances (SimpleDecimalEncoder)

  • Django middleware for exception logging/emailing (LogExceptionMiddleware)

  • Django middleware for language cookie handling (EnsureLanguageCookieMiddleware)

  • Django middleware for user.profile.timezone based timezone activation

  • Utilities or Django Model handling (e.g. clone_model, get_object_or_none)

  • Utilities for parsing booleans and datetime values (using pytz)

  • Simple user field based permission checking for REST APIs (permissions.py)

  • Geo IP / IP info functions using IPStack API (request.py)

  • Download responses (FileSystemFileResponse and CsvFileResponse)

  • Simple SMS sending (send_sms)

  • Mixin for basic test user setup (DefaultTestSetupMixin)

  • Pretty good unit test coverage (tests.py)

  • URL modifying/comparison functions (urls.py)

  • Validators and filters for various types (validators.py)

  • XML Element to/from dict conversions (dict_to_element, xml_to_dict)

Install

pip install django-jutil

Changes

2.2.3: + ElementTree import cleanup (thanks to https://github.com/kutera)

2.2.0: + Belgium IBAN validation support (thanks to https://github.com/kutera)

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-jutil-2.2.36.tar.gz (81.6 kB view details)

Uploaded Source

File details

Details for the file django-jutil-2.2.36.tar.gz.

File metadata

  • Download URL: django-jutil-2.2.36.tar.gz
  • Upload date:
  • Size: 81.6 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/3.6.8

File hashes

Hashes for django-jutil-2.2.36.tar.gz
Algorithm Hash digest
SHA256 ff1cd58e7f141f5f226a62c0dfd78507abe31c6e369943a159788f7e365cb479
MD5 cbb1a34ec4d3a46fbe0c160a78b1b5cc
BLAKE2b-256 c1aaffc16a5e8d639f6ed4246c892469129d0ed4bf7f85c99b1d768ae3c19e02

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