Overview
Integrate ATP with Django to expose your tools as HTTP endpoints within your Django application.Installation
Setup
Step 1: Add to INSTALLED_APPS
Add"django_atp" to your INSTALLED_APPS in settings.py:
Step 2: Include URLs
Include the ATP URLs in your project’surls.py:
Step 3: Create ATP Tools Module
Create a module to register your toolkits and tools (e.g.,myapp/atp_tools.py):
Step 4: Import in AppConfig
Import the ATP tools module in your app’sapps.py to ensure registration at startup:
Step 5: Update init.py
Make sure your app uses the custom AppConfig:Usage
Endpoints
Once set up, your tools are exposed at:- GET
/atp/<toolkit_name>/- Get toolkit details and list of tools - GET
/atp/<toolkit_name>/<tool_name>/- Get tool context/schema - POST
/atp/<toolkit_name>/<tool_name>/- Execute a tool with parameters
Example Requests
Get Toolkit Details
Get Tool Context
Execute Tool
Complete Example
Here’s a complete example of a Django app with ATP integration:Advanced Usage
Using Django Models
You can access Django models directly in your tools:Using Django Authentication
You can use Django’s authentication system in your tools:Next Steps
ToolKitClient
Learn more about ToolKitClient
OAuth2 Guide
Set up OAuth2 authentication
FastAPI Integration
Try ATP with FastAPI
Examples
Explore more examples