| Name | drf-postman JSON |
| Version |
0.1.0
JSON |
| download |
| home_page | None |
| Summary | A Django + DRF package to generate Postman v2.1 collections with a single command |
| upload_time | 2025-10-13 04:24:58 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.8 |
| license | None |
| keywords |
django
drf
postman
collections
api
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# DRF Postman
Generate Postman Collections from your Django REST Framework APIs with a single command. This tool automatically introspects your DRF routes and generates a ready-to-import Postman Collection v2.1 JSON file.
## Installation
```bash
pip install drf-postman
```
Add to your `INSTALLED_APPS`:
```py
INSTALLED_APPS = [
# ...
'drf_postman'
]
```
Configure your REST framework settings:
```py
REST_FRAMEWORK = {
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
}
```
## Quick Start
Generate a Postman collection:
```bash
python3 manage.py generatepostman
```
This creates `postman_collection.json` in your project root. Import into Postman and start testing!
## Usage
### Basic Command
```bash
python3 manage.py generatepostman
```
### With Options
```bash
# Custom output path
python3 manage.py generatepostman --output my_api.json
# Custom collection name
python3 manage.py generatepostman --name "My Awesome API"
# Custom base URL
python3 manage.py generatepostman --base-url "https://api.example.com"
# All together
python3 manage.py generatepostman -o collections/api.json -n "My API v2" -b "https://staging.api.com"
```
## Configuration
Customize defaults in your `settings.py`:
```py
DRF_POSTMAN = {
'COLLECTION_NAME': 'My API',
'BASE_URL': 'https://api.example.com',
'OUTPUT_PATH': 'postman_collection.json',
}
```
## What Gets Generated
### Collection Structure
```
My API Collection
├── Accounts
│ ├── POST Login
│ └── POST Register
└── Todos
├── GET List Todos
├── POST Create Todo
├── GET Retrieve Todo
├── PUT Update Todo
└── DELETE Delete Todo
```
### Request Features
- Method & URL: Correctly formatted with path parameters
- Headers: Content-Type and Authorization when needed
- Body: JSON examples generated from serializers
- Parameters: Path and query parameters with descriptions
- Variables: {{base_url}} environment variable included
### Example Request Body
For a serializer like:
```python
class TodoSerializer(serializers.ModelSerializer):
class Meta:
model = Todo
fields = ['id', 'title', 'description', 'completed']
read_only_fields = ['id']
```
Generates:
```json
{
"title": "string",
"description": "string",
"completed": true
}
```
> Note: `id` is excluded because it's read-only.
## Requirements
- Python >= 3.8
- Django >= 3.2
- Django REST Framework >= 3.12
- drf-spectacular >= 0.26.0
## How It Works
1. Uses `drf-spectacular` to generate an OpenAPI 3.0 schema from your DRF routes
2. Converts the OpenAPI schema to Postman Collection v2.1 format
3. Groups endpoints by tags (typically ViewSet names)
4. Generates example request bodies from serializer schemas
5. Includes authentication, parameters, and metadata
## Limitations
- Requires `drf-spectacular` for schema generation
## Example Project
Check out the `example_project/` directory for a complete example with:
- JWT Authentication
- django-filter integration
- Multiple related models
Run it:
```bash
cd example_project
pip install -r requirements.txt
python3 manage.py migrate
python3 manage.py generatepostman
```
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## Testing
Tests coming soon :)
## License
MIT License - see [LICENSE](./LICENSE.md) file for details.
## Support
If you encounter any issues or have questions:
1. [Open an issue](https://github.com/kimanikevin254/django-drf-postman/issues)
2. Check existing issues for solutions
---
⭐ Star this repo if you find it useful!
Raw data
{
"_id": null,
"home_page": null,
"name": "drf-postman",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "django, drf, postman, collections, api",
"author": null,
"author_email": "Kevin Kimani <kimanikevin254@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/fa/0d/049ac3555f4b0da0a3fe93377014c98c473f3af421e9c321a5974f357bf8/drf_postman-0.1.0.tar.gz",
"platform": null,
"description": "# DRF Postman\n\nGenerate Postman Collections from your Django REST Framework APIs with a single command. This tool automatically introspects your DRF routes and generates a ready-to-import Postman Collection v2.1 JSON file.\n\n## Installation\n\n```bash\npip install drf-postman\n```\n\nAdd to your `INSTALLED_APPS`:\n\n```py\nINSTALLED_APPS = [\n # ...\n 'drf_postman'\n]\n```\n\nConfigure your REST framework settings:\n\n```py\nREST_FRAMEWORK = {\n 'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',\n}\n```\n\n## Quick Start\n\nGenerate a Postman collection:\n\n```bash\npython3 manage.py generatepostman\n```\n\nThis creates `postman_collection.json` in your project root. Import into Postman and start testing!\n\n## Usage\n\n### Basic Command\n\n```bash\npython3 manage.py generatepostman\n```\n\n### With Options\n\n```bash\n# Custom output path\npython3 manage.py generatepostman --output my_api.json\n\n# Custom collection name\npython3 manage.py generatepostman --name \"My Awesome API\"\n\n# Custom base URL\npython3 manage.py generatepostman --base-url \"https://api.example.com\"\n\n# All together\npython3 manage.py generatepostman -o collections/api.json -n \"My API v2\" -b \"https://staging.api.com\"\n```\n\n## Configuration\n\nCustomize defaults in your `settings.py`:\n\n```py\nDRF_POSTMAN = {\n 'COLLECTION_NAME': 'My API',\n 'BASE_URL': 'https://api.example.com',\n 'OUTPUT_PATH': 'postman_collection.json',\n}\n```\n\n## What Gets Generated\n\n### Collection Structure\n\n```\nMy API Collection\n\u251c\u2500\u2500 Accounts\n\u2502 \u251c\u2500\u2500 POST Login\n\u2502 \u2514\u2500\u2500 POST Register\n\u2514\u2500\u2500 Todos\n \u251c\u2500\u2500 GET List Todos\n \u251c\u2500\u2500 POST Create Todo\n \u251c\u2500\u2500 GET Retrieve Todo\n \u251c\u2500\u2500 PUT Update Todo\n \u2514\u2500\u2500 DELETE Delete Todo\n```\n\n### Request Features\n\n- Method & URL: Correctly formatted with path parameters\n- Headers: Content-Type and Authorization when needed\n- Body: JSON examples generated from serializers\n- Parameters: Path and query parameters with descriptions\n- Variables: {{base_url}} environment variable included\n\n### Example Request Body\n\nFor a serializer like:\n\n```python\nclass TodoSerializer(serializers.ModelSerializer):\n class Meta:\n model = Todo\n fields = ['id', 'title', 'description', 'completed']\n read_only_fields = ['id']\n```\n\nGenerates:\n\n```json\n{\n \"title\": \"string\",\n \"description\": \"string\",\n \"completed\": true\n}\n```\n\n> Note: `id` is excluded because it's read-only.\n\n## Requirements\n\n- Python >= 3.8\n- Django >= 3.2\n- Django REST Framework >= 3.12\n- drf-spectacular >= 0.26.0\n\n## How It Works\n\n1. Uses `drf-spectacular` to generate an OpenAPI 3.0 schema from your DRF routes\n2. Converts the OpenAPI schema to Postman Collection v2.1 format\n3. Groups endpoints by tags (typically ViewSet names)\n4. Generates example request bodies from serializer schemas\n5. Includes authentication, parameters, and metadata\n\n## Limitations\n\n- Requires `drf-spectacular` for schema generation\n\n## Example Project\n\nCheck out the `example_project/` directory for a complete example with:\n\n- JWT Authentication\n- django-filter integration\n- Multiple related models\n\nRun it:\n\n```bash\ncd example_project\npip install -r requirements.txt\npython3 manage.py migrate\npython3 manage.py generatepostman\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## Testing\n\nTests coming soon :)\n\n## License\n\nMIT License - see [LICENSE](./LICENSE.md) file for details.\n\n## Support\n\nIf you encounter any issues or have questions:\n\n1. [Open an issue](https://github.com/kimanikevin254/django-drf-postman/issues)\n2. Check existing issues for solutions\n\n---\n\n\u2b50 Star this repo if you find it useful!\n",
"bugtrack_url": null,
"license": null,
"summary": "A Django + DRF package to generate Postman v2.1 collections with a single command",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/kimanikevin254/django-drf-postman",
"Issues": "https://github.com/kimanikevin254/django-drf-postman/issues",
"Repository": "https://github.com/kimanikevin254/django-drf-postman"
},
"split_keywords": [
"django",
" drf",
" postman",
" collections",
" api"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "bd6f62a2cc4e37bb1629b61284e6e9b8420c6701678e095207878b2a727d158a",
"md5": "1b9b75d47b9193568cce9d4f13b3a5ed",
"sha256": "90867aeee8f461f6c4f718c2cc172181eeecdfd05eaa94f51ad60ff3904261d4"
},
"downloads": -1,
"filename": "drf_postman-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1b9b75d47b9193568cce9d4f13b3a5ed",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 9714,
"upload_time": "2025-10-13T04:24:56",
"upload_time_iso_8601": "2025-10-13T04:24:56.535225Z",
"url": "https://files.pythonhosted.org/packages/bd/6f/62a2cc4e37bb1629b61284e6e9b8420c6701678e095207878b2a727d158a/drf_postman-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "fa0d049ac3555f4b0da0a3fe93377014c98c473f3af421e9c321a5974f357bf8",
"md5": "1dfeb6d7afd9db2cf80649efc88c3547",
"sha256": "1455424491a881e73c034113ff0d6007263e0b21678b82bd50199a5a3caf75c0"
},
"downloads": -1,
"filename": "drf_postman-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "1dfeb6d7afd9db2cf80649efc88c3547",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 10557,
"upload_time": "2025-10-13T04:24:58",
"upload_time_iso_8601": "2025-10-13T04:24:58.279758Z",
"url": "https://files.pythonhosted.org/packages/fa/0d/049ac3555f4b0da0a3fe93377014c98c473f3af421e9c321a5974f357bf8/drf_postman-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-13 04:24:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kimanikevin254",
"github_project": "django-drf-postman",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "drf-postman"
}