Skip to main content

Collection of useful checks for Django Checks Frameworks

Project description

Django Extra Checks

Useful checks for Django Checks Frameworks

Settings

To enable some check define EXTRA_CHECKS setting with a dict of checks and its settings, eg:

EXTRA_CHECKS = {
    "checks": [
        # require non empty `upload_to` argument.
        'X002',
        # use dict form if check need configuration
        # eg. all models must have fk to Site model
        {"id": "X003", "attrs": ["site"]},
        # require `db_table` for all models, increase level to CRITICAL
        {"id": "X004", "attrs": ["db_table"], "level": "CRITICAL"},
    ]
}

To ignore model warnings you can use ignore_checks decorator, eg:

from extra_checks import ignore_checks, CheckID

@ignore_checks("X002", CheckID.X003)
class MyModel(models.Model):
    image = models.ImageField()

Checks

  • X001 - settings.EXTRA_CHECKS is valid config for django-extra-checks (always enabled).
  • X002 - FileField/ImageField must have non empty upload_to argument.
  • X003 - Each Model in the project must have all attributes from attrs setting specified.
  • X004 - Each Model.Meta in the project must have all attributes from attrs setting specified.
  • X005 - All model's fields must have verbose name.
  • X006 - verbose_name must use gettext
  • X007 - Words in text wrapped with gettext must be in one case.
  • X008 - help_text must use gettext

Development

Install dev deps in virtualenv pip install -e .[dev].

Credits

The project was built using ideas and code snippets from:

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

django-extra-checks-0.1.0a0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_extra_checks-0.1.0a0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file django-extra-checks-0.1.0a0.tar.gz.

File metadata

  • Download URL: django-extra-checks-0.1.0a0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

File hashes

Hashes for django-extra-checks-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 62dac8b1fcf63b445be490d0b71c1779c45f315fec7552e675329086b92cb264
MD5 62238a32a59418d7123af3fd3910afc7
BLAKE2b-256 f809509feb8259224e8c795a2ebf357b4690e7b8c8f9e4be7a419ee5a29c8759

See more details on using hashes here.

File details

Details for the file django_extra_checks-0.1.0a0-py3-none-any.whl.

File metadata

  • Download URL: django_extra_checks-0.1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

File hashes

Hashes for django_extra_checks-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 425280731ce6a9403aa645f5ccb8f3c7f11eb8b2a411d3cdc605daccb2e67be1
MD5 6103f95ecd0fa1b34ad920e0e6a7f3eb
BLAKE2b-256 0e6a4086e24d24b36f5cac4f7b45283e62bf791bc3abbdfb80e714c51966bd3d

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