# ๐ Crashpad - A Soft Landing for Your Django Crashes
Error tracking SDK for Django and Django REST Framework applications. When your code crashes, Crashpad catches it gracefully.
## โจ Features
- ๐ฏ **Zero Configuration**: One line to set up, no middleware needed
- ๐ **Full Context Capture**: Automatically captures request info, user details, and code snapshots
- ๐ **Django & DRF Support**: Works seamlessly with both Django and Django REST Framework
- ๐งต **Thread-Safe**: Uses thread-local storage for reliable request tracking
- ๐ธ **Code Snapshots**: Shows the exact lines of code where errors occurred
- ๐ **Reversed Stack Traces**: Error message first, most recent call first - easier to read
- ๐คฎ **Debug Mode**: Save errors locally with the hilarious `logs๐คฎ` directory
## ๐ฆ Installation
```bash
pip install crashpad
```
## ๐ Quick Start
### Django Setup
In your Django `settings.py`:
```python
import crashpad
# Initialize with your API key URL - that's it!
crashpad.init(key="http://your-api-server.com/YOUR_PROJECT_KEY")
```
### Django REST Framework Setup
Same simple setup for DRF:
```python
import crashpad
# Initialize Crashpad
crashpad.init(key="http://your-api-server.com/YOUR_PROJECT_KEY")
```
That's it! No middleware, no additional configuration needed. Crashpad automatically captures all errors using Django signals.
## ๐ What Gets Tracked
When an error occurs, Crashpad automatically captures:
- **Error details**: Exception type, message, and reversed stack trace (error first!)
- **Code snapshot**: The exact lines of code around where the error occurred
- **Request information**:
- HTTP method (GET, POST, PUT, DELETE, etc.)
- Full URL path
- Authenticated user or "anonymous"
- **File location**: Filename, function name, and line number
- **Timestamp**: Exact time when the error occurred
## ๐ฏ Example
Here's a complete example with Django settings:
```python
# settings.py
import crashpad
# Initialize Crashpad - one line!
crashpad.init(key="http://127.0.0.1:9000/your-project-key")
# Your regular Django/DRF settings continue...
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'rest_framework',
# ... your apps
]
REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 100,
}
```
## ๐ง How It Works
1. **Signal-Based Integration**: Connects to Django's `got_request_exception` signal
2. **Automatic Request Capture**: Uses a logging filter to extract request information
3. **Thread-Local Storage**: Safely stores request context during error handling
4. **No Middleware Required**: Works automatically without middleware configuration
5. **Universal Coverage**: Captures errors from views, DRF endpoints, background tasks, and logging calls
6. **Smart Extraction**: Safely extracts HTTP method, URL, and user information
7. **Flexible Deployment**: Send to API in production, save locally in debug mode
## ๐ Debug Mode
Want to see errors saved locally? Enable debug mode:
```python
import crashpad
crashpad.DEBUG = True
crashpad.init(key="http://your-api-server.com/YOUR_PROJECT_KEY")
```
Errors will be saved to a `logs๐คฎ` directory as JSON files. Yes, the emoji is intentional! ๐คฎ
## ๐ Requirements
- Python 3.6+
- Django 3.2+
- Django REST Framework (optional, for DRF integration)
## ๐ License
MIT License - see LICENSE file for details
## ๐ค Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
## ๐ฏ Why "Crashpad"?
Because when your code takes a dive, it deserves a soft landing! ๐
---
Made with โค๏ธ for Django developers who believe error tracking shouldn't be complicated.
Raw data
{
"_id": null,
"home_page": null,
"name": "crashpad",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "django, error-tracking, logging, monitoring, crash-reporting, exception-tracking",
"author": "Crashpad Team",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/29/c1/e10bc25571ad97ab5766567fece01adb8a13295ef76d82992d4f6414e263/crashpad-0.1.0b0.tar.gz",
"platform": null,
"description": "# \ud83d\udedf Crashpad - A Soft Landing for Your Django Crashes\r\n\r\nError tracking SDK for Django and Django REST Framework applications. When your code crashes, Crashpad catches it gracefully.\r\n\r\n## \u2728 Features\r\n\r\n- \ud83c\udfaf **Zero Configuration**: One line to set up, no middleware needed\r\n- \ud83d\udd0d **Full Context Capture**: Automatically captures request info, user details, and code snapshots\r\n- \ud83d\ude80 **Django & DRF Support**: Works seamlessly with both Django and Django REST Framework\r\n- \ud83e\uddf5 **Thread-Safe**: Uses thread-local storage for reliable request tracking\r\n- \ud83d\udcf8 **Code Snapshots**: Shows the exact lines of code where errors occurred\r\n- \ud83d\udd04 **Reversed Stack Traces**: Error message first, most recent call first - easier to read\r\n- \ud83e\udd2e **Debug Mode**: Save errors locally with the hilarious `logs\ud83e\udd2e` directory\r\n\r\n## \ud83d\udce6 Installation\r\n\r\n```bash\r\npip install crashpad\r\n```\r\n\r\n## \ud83d\ude80 Quick Start\r\n\r\n### Django Setup\r\n\r\nIn your Django `settings.py`:\r\n\r\n```python\r\nimport crashpad\r\n\r\n# Initialize with your API key URL - that's it!\r\ncrashpad.init(key=\"http://your-api-server.com/YOUR_PROJECT_KEY\")\r\n```\r\n\r\n### Django REST Framework Setup\r\n\r\nSame simple setup for DRF:\r\n\r\n```python\r\nimport crashpad\r\n\r\n# Initialize Crashpad\r\ncrashpad.init(key=\"http://your-api-server.com/YOUR_PROJECT_KEY\")\r\n```\r\n\r\nThat's it! No middleware, no additional configuration needed. Crashpad automatically captures all errors using Django signals.\r\n\r\n## \ud83d\udcca What Gets Tracked\r\n\r\nWhen an error occurs, Crashpad automatically captures:\r\n\r\n- **Error details**: Exception type, message, and reversed stack trace (error first!)\r\n- **Code snapshot**: The exact lines of code around where the error occurred\r\n- **Request information**:\r\n - HTTP method (GET, POST, PUT, DELETE, etc.)\r\n - Full URL path\r\n - Authenticated user or \"anonymous\"\r\n- **File location**: Filename, function name, and line number\r\n- **Timestamp**: Exact time when the error occurred\r\n\r\n## \ud83c\udfaf Example\r\n\r\nHere's a complete example with Django settings:\r\n\r\n```python\r\n# settings.py\r\n\r\nimport crashpad\r\n\r\n# Initialize Crashpad - one line!\r\ncrashpad.init(key=\"http://127.0.0.1:9000/your-project-key\")\r\n\r\n# Your regular Django/DRF settings continue...\r\nINSTALLED_APPS = [\r\n 'django.contrib.admin',\r\n 'django.contrib.auth',\r\n 'rest_framework',\r\n # ... your apps\r\n]\r\n\r\nREST_FRAMEWORK = {\r\n 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',\r\n 'PAGE_SIZE': 100,\r\n}\r\n```\r\n\r\n## \ud83d\udd27 How It Works\r\n\r\n1. **Signal-Based Integration**: Connects to Django's `got_request_exception` signal\r\n2. **Automatic Request Capture**: Uses a logging filter to extract request information\r\n3. **Thread-Local Storage**: Safely stores request context during error handling\r\n4. **No Middleware Required**: Works automatically without middleware configuration\r\n5. **Universal Coverage**: Captures errors from views, DRF endpoints, background tasks, and logging calls\r\n6. **Smart Extraction**: Safely extracts HTTP method, URL, and user information\r\n7. **Flexible Deployment**: Send to API in production, save locally in debug mode\r\n\r\n## \ud83d\udc1b Debug Mode\r\n\r\nWant to see errors saved locally? Enable debug mode:\r\n\r\n```python\r\nimport crashpad\r\n\r\ncrashpad.DEBUG = True\r\ncrashpad.init(key=\"http://your-api-server.com/YOUR_PROJECT_KEY\")\r\n```\r\n\r\nErrors will be saved to a `logs\ud83e\udd2e` directory as JSON files. Yes, the emoji is intentional! \ud83e\udd2e\r\n\r\n## \ud83d\udccb Requirements\r\n\r\n- Python 3.6+\r\n- Django 3.2+\r\n- Django REST Framework (optional, for DRF integration)\r\n\r\n## \ud83d\udcc4 License\r\n\r\nMIT License - see LICENSE file for details\r\n\r\n## \ud83e\udd1d Contributing\r\n\r\nContributions are welcome! Feel free to open issues or submit pull requests.\r\n\r\n## \ud83c\udfaf Why \"Crashpad\"?\r\n\r\nBecause when your code takes a dive, it deserves a soft landing! \ud83d\udedf\r\n\r\n---\r\n\r\nMade with \u2764\ufe0f for Django developers who believe error tracking shouldn't be complicated.\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A soft landing for your Django crashes - Error tracking SDK for Django applications",
"version": "0.1.0b0",
"project_urls": {
"Bug Tracker": "https://github.com/alamin040246/crashpad/issues",
"Homepage": "https://github.com/alamin040246/crashpad",
"Repository": "https://github.com/alamin040246/crashpad"
},
"split_keywords": [
"django",
" error-tracking",
" logging",
" monitoring",
" crash-reporting",
" exception-tracking"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "b01c21db8a4e21b0eb65cdc24d554d715000c05eae201d5e68f17c978e0bc119",
"md5": "bb92a54c84b9be96996cc2d1b690d22e",
"sha256": "96ba76f0ad978f13c1660bf2d82da1c8db408bdc746acd95dbfe8f5958c57196"
},
"downloads": -1,
"filename": "crashpad-0.1.0b0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bb92a54c84b9be96996cc2d1b690d22e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 8399,
"upload_time": "2025-10-23T06:32:37",
"upload_time_iso_8601": "2025-10-23T06:32:37.424132Z",
"url": "https://files.pythonhosted.org/packages/b0/1c/21db8a4e21b0eb65cdc24d554d715000c05eae201d5e68f17c978e0bc119/crashpad-0.1.0b0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "29c1e10bc25571ad97ab5766567fece01adb8a13295ef76d82992d4f6414e263",
"md5": "f3738d27954baf3dba6d76d019c66bb6",
"sha256": "3cb1b0f3e2268142695735e9575edc5ada9e53535d047f039ab0ac697c764ade"
},
"downloads": -1,
"filename": "crashpad-0.1.0b0.tar.gz",
"has_sig": false,
"md5_digest": "f3738d27954baf3dba6d76d019c66bb6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7765,
"upload_time": "2025-10-23T06:32:38",
"upload_time_iso_8601": "2025-10-23T06:32:38.719248Z",
"url": "https://files.pythonhosted.org/packages/29/c1/e10bc25571ad97ab5766567fece01adb8a13295ef76d82992d4f6414e263/crashpad-0.1.0b0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-23 06:32:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "alamin040246",
"github_project": "crashpad",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "crashpad"
}