A tool/plugin to assist with finding broken links on your wagtail site. This tool works asynchronously using celery.
Installing
Install using pip:
pip install wagtail-linkchecker
It works with Wagtail 1.0 and upwards.
Using
To use, firstly you will need to add wagtaillinkchecker to your INSTALLED_APPS and run the migrations. There will now be an extra item on the settings panel of the wagtailadmin. Inside here you can enable or disable automated scanning (See below for more detail) or conduct a scan.
For scans to be conducted from the admin, you must be running a celery daemon. You can run the celery worker with celery -A wagtaillinkchecker worker -l info. See the Celery Documentation for more information. For production you’ll want to run celery as a daemon using something like systemd. See Celery Daemonization for more information.
Conducting a scan
Conducting a scan will scan all of your wagtail pages, and detect all images and anchors with a src or href respectively. Utilising the requests and BeautifulSoup libraries, requests will be made to each link to make sure an appropriate response is received, and if no appropriate response is received, once the scan is complete, all broken links along with their status codes and reasons will appear.
Scan results will be stored.
Automated Scanning
If you want automated scanning to work you HAVE to set up a cron job. The cron job will need to run the management command linkchecker at an interval of your choosing. The automated scans will do the same as manually conducting a scan, but instead will email the last person to edit the page with broken links/images.
Command options
- --do-not-send-mail
Don’t send an email to administrators once scan is complete.
- --run-synchronously
Skip celery and run command synchronously (useful for automated scanning)
- -v 2
Show more output in the logs
Release files for wagtail-linkchecker 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| wagtail-linkchecker-0.6.0.tar.gz | 14.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wagtail_linkchecker-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.9 kB
Release files / wagtail-linkchecker-0.6.0.tar.gz
| Download URL | wagtail-linkchecker-0.6.0.tar.gz |
|---|---|
| Size | 14.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2bdd457ee757ae52e0f00196739e84f5f21e0e40212ae3d6170e108efd62b6e1
|
|
BLAKE2b-256 checksum How to use checksums |
29ed40cba5b532c63573b9e0da09c7350964495b7c54e32113a88a88b234503d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.6
|
Release files / wagtail_linkchecker-0.6.0-py3-none-any.whl
| Download URL | wagtail_linkchecker-0.6.0-py3-none-any.whl |
|---|---|
| Size | 23.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
15b0a81295fe74be2e3deadbb99b4206232cbfeb11baac9c480d224bc4ee1491
|
|
BLAKE2b-256 checksum How to use checksums |
5ead5953f61f8ba7ac481b3685fbfc553d70c35445fe23700beaf18609efa64f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.6
|