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
django-extra-checks-0.1.0.tar.gz
(10.1 kB
view hashes)
Built Distribution
Close
Hashes for django-extra-checks-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cf9bfc0afc991d282aeb3c012bb98642e63e87dc85d969a3053aa177d2ec2d4 |
|
MD5 | 7a4c95513b8b733e8b9093fea0cd4e30 |
|
BLAKE2b-256 | b4ae883bd79284949b9688c7b03c3722f0aac94b09944433b3efbd9565e023ed |
Close
Hashes for django_extra_checks-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a262c974bff41efeb5acdcf11f45c8fc86a3d83d39b67bbe6915153b7db421a |
|
MD5 | 269b92cb9ff8ea7b275d54da33b66000 |
|
BLAKE2b-256 | 637284ec0a6e098b498bed9f2d202d4defb7d0f91ab5dc9c9ed627d229a77af0 |