https://github.com/dlrsp/django-errors
Django application for handling server errors.
https://github.com/dlrsp/django-errors
django error-handling errors python
Last synced: 9 months ago
JSON representation
Django application for handling server errors.
- Host: GitHub
- URL: https://github.com/dlrsp/django-errors
- Owner: DLRSP
- License: mit
- Created: 2016-01-04T00:39:45.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2024-11-15T08:17:02.000Z (about 1 year ago)
- Last Synced: 2024-11-15T09:24:45.719Z (about 1 year ago)
- Topics: django, error-handling, errors, python
- Language: Python
- Homepage: https://dlrsp.github.io/django-errors/
- Size: 3.33 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# django-errors [](https://pypi.python.org/pypi/django_errors)
[](https://pypi.python.org/pypi/django_errors)
[](https://pypi.python.org/pypi/django_errors)
[](https://pypi.python.org/pypi/django_errors)
[](https://pypi.python.org/pypi/django_errors)
[](https://pypi.python.org/pypi/django_errors)
[](https://pypi.python.org/pypi/django_errors)
## GitHub  
## Test [](https://codecov.io/github/DLRSP/django-errors?branch=main) [](https://results.pre-commit.ci/latest/github/DLRSP/django-errors/main) [](https://github.com/DLRSP/django-errors/actions/workflows/ci.yaml)
## Check Demo Project
* Browser the demo app on-line on [Heroku](https://django-errors.herokuapp.com/)
* Check the demo repo on [GitHub](https://github.com/DLRSP/example/tree/django-errors)
## Requirements
- Python 3.8+ supported.
- Django 3.2+ supported.
## Setup
1. Install from **pip**:
```shell
pip install django-errors
```
2. modify `settings.py` by adding the app to `INSTALLED_APPS`:
```python
INSTALLED_APPS = [
# ...
"django_errors",
# ...
]
```
3. Finally, modify your project `urls.py` with handlers for all errors:
```python
# ...other imports...
from django_errors import views as errors_views
urlpatterns = [
# ...other urls...
]
handler400 = errors_views.custom_400
""" Handle 400 error """
handler403 = errors_views.custom_403
""" Handle 403 error """
handler404 = errors_views.custom_404
""" Handle 404 error """
handler500 = errors_views.custom_500
""" Handle 500 error """
```
## Run Example Project
```shell
git clone --depth=50 --branch=django-errors https://github.com/DLRSP/example.git DLRSP/example
cd DLRSP/example
python manage.py runserver
```
Now browser the app @ http://127.0.0.1:8000