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
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
Built Distribution
Close
Hashes for django-extra-checks-0.1.0a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62dac8b1fcf63b445be490d0b71c1779c45f315fec7552e675329086b92cb264 |
|
MD5 | 62238a32a59418d7123af3fd3910afc7 |
|
BLAKE2b-256 | f809509feb8259224e8c795a2ebf357b4690e7b8c8f9e4be7a419ee5a29c8759 |
Close
Hashes for django_extra_checks-0.1.0a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 425280731ce6a9403aa645f5ccb8f3c7f11eb8b2a411d3cdc605daccb2e67be1 |
|
MD5 | 6103f95ecd0fa1b34ad920e0e6a7f3eb |
|
BLAKE2b-256 | 0e6a4086e24d24b36f5cac4f7b45283e62bf791bc3abbdfb80e714c51966bd3d |