django-spam
Inspired by this Nick Craver tweet https://twitter.com/nick_craver/status/720062942960623616
We all hate bots, lets admit it. Especially the ones that try to gain access to our most secret endpoints. Well we have an easy solution for your django application. django_spam simply adds common admin urls to url conf so when bots (or human for that matter) try and access them, they will get redirected...
| Django 2.0 | Django 2.1 | Django 2.2 | Django 3.0 | Django 3.1 | Django 3.2 | |
|---|---|---|---|---|---|---|
| Python 3.4 | ✔️ | |||||
| Python 3.5 | ✔️ | ✔️ | ✔️ | |||
| Python 3.6 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Python 3.7 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Python 3.8 | ✔️ | ✔️ | ✔️ | ✔️ | ||
| Python 3.9 | ✔️ | ✔️ | ✔️ |
Installation / Usage
pip install django-spam
Add to apps list:
INSTALLED_APPS = [
'...',
'django_spam',
'...'
]
django_spam ships with some default endpoints bots might try to hit. If you would like to add extra routes, simply add
a SPAM_ROUTES variable to your settings file that contains a list of extra endpoints you would like
to add. no leading slashes
SPAM_ROUTES = [
'admin.php',
'admin/login.php',
'administrator/index.php',
'index.php',
'...',
]
Include django_spam.urls to root url file:
'...'
path('', include('django_spam.urls')),
'...',
If for some odd reason you need to exclude routes, define EXCLUDED_ROUTES in settings. no leading slashes
EXCLUDED_ROUTES = [
'admin.php',
'index.php'
]
Demo
See here
Development
This project uses Poetry to manage dev environment. Once installed:
- Clone and
cdinto repo - install packages with
poetry install - black
poetry run black . - flake8
poetry run flake8 - test
poetry run coverage run --source=django_spam setup.py test
Metadata
Release files for django-spam 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_spam-2.0.1.tar.gz | 7.4 kB | Without provenance | Details for django_spam-2.0.1.tar.gz |
Release files / django_spam-2.0.1.tar.gz
| Download URL | django_spam-2.0.1.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9859243a48eee6d37879adb2e2c1733d47c99fa8783e7883ebf5c17ded3dafcb
|
|
BLAKE2b-256 checksum How to use checksums |
8602241515deca7e514af3023d26f1ee80eeae7a6bff147b5f46c6675cf27c27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.2
|
Security for django-spam 2.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.