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_toargument. - X003 - Each Model in the project must have all attributes from
attrssetting specified. - X004 - Each Model.Meta in the project must have all attributes from
attrssetting 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62dac8b1fcf63b445be490d0b71c1779c45f315fec7552e675329086b92cb264
|
|
| MD5 |
62238a32a59418d7123af3fd3910afc7
|
|
| BLAKE2b-256 |
f809509feb8259224e8c795a2ebf357b4690e7b8c8f9e4be7a419ee5a29c8759
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
425280731ce6a9403aa645f5ccb8f3c7f11eb8b2a411d3cdc605daccb2e67be1
|
|
| MD5 |
6103f95ecd0fa1b34ad920e0e6a7f3eb
|
|
| BLAKE2b-256 |
0e6a4086e24d24b36f5cac4f7b45283e62bf791bc3abbdfb80e714c51966bd3d
|