AI-powered GitHub issue creation and management system for Django with conversational UX and LLM enhancement
Project description
Django Issue Capture
AI-powered GitHub issue creation and management system for Django with LLM enhancement.
Features
- AI-Powered Issue Generation: Use LiteLLM to generate comprehensive issues from basic descriptions
- Model Optionality: Support for OpenAI, Anthropic, Ollama, and any LiteLLM-compatible provider
- GitHub Integration: Direct promotion of issues to GitHub repositories
- Template System: Predefined templates for bugs, features, tasks, and enhancements
- HTMX Admin: Interactive admin interface with one-click GitHub promotion
- Markdown Support: Full markdown rendering with sanitization
Installation
pip install django-issue-capture
Quick Start
- Add to
INSTALLED_APPS:
INSTALLED_APPS = [
# ...
"solo", # Required dependency
"django_markdownify", # For markdown rendering
"django_issue_capture",
]
- Add context processor (optional, for floating button):
TEMPLATES = [{
'OPTIONS': {
'context_processors': [
# ...
'django_issue_capture.context_processors.issue_capture_settings',
],
},
}]
- Include URLs:
from django.urls import include, path
urlpatterns = [
# ...
path("issues/", include("django_issue_capture.urls")),
]
- Run migrations:
python manage.py migrate
- Configure in Django Admin:
Navigate to Issue Capture Settings and configure:
- GitHub: Repository (
owner/repo) and Personal Access Token - LLM: API key and model (e.g.,
gpt-4o-mini,anthropic/claude-3-5-sonnet-20241022)
- Set up issue templates:
python manage.py setup_issue_templates
Configuration
LLM Models
This package uses LiteLLM for model optionality. Use the format provider/model-name:
| Provider | Model Format | API Key Prefix |
|---|---|---|
| OpenAI | gpt-4o-mini, gpt-4o |
sk-... |
| Anthropic | anthropic/claude-3-5-sonnet-20241022 |
sk-ant-... |
| Ollama (local) | ollama_chat/llama3, ollama_chat/mistral |
(none) |
| Azure OpenAI | azure/deployment-name |
(Azure key) |
Note: OpenAI models work without a prefix. Most other providers require the
provider/prefix.
See LiteLLM providers for the full list.
GitHub Integration
To promote issues to GitHub, you need a Personal Access Token (PAT) with the appropriate permissions.
Creating a Personal Access Token
Option 1: Fine-grained token (Recommended)
Fine-grained tokens provide more granular control and are GitHub's recommended approach:
- Go to GitHub Settings
- Click Developer settings (bottom of left sidebar)
- Click Personal access tokens → Fine-grained tokens
- Click Generate new token
- Configure the token:
- Token name: e.g., "Django Issue Capture"
- Expiration: Choose based on your security requirements
- Repository access: Select "Only select repositories" and choose the target repo(s)
- Permissions: Under "Repository permissions", set:
- Issues: Read and write (required to create issues)
- Metadata: Read-only (automatically selected)
- Click Generate token
- Copy the token immediately (it won't be shown again)
Option 2: Classic token
Classic tokens are simpler but have broader access:
- Go to GitHub Settings
- Click Developer settings (bottom of left sidebar)
- Click Personal access tokens → Tokens (classic)
- Click Generate new token → Generate new token (classic)
- Configure the token:
- Note: e.g., "Django Issue Capture"
- Expiration: Choose based on your security requirements
- Scopes: Select
repo(grants full control of private repositories, including issues)
- Click Generate token
- Copy the token immediately (it won't be shown again)
Required Permissions
| Permission | Type | Purpose |
|---|---|---|
| Issues | Read and write | Create and manage issues in the repository |
| Metadata | Read-only | Access repository metadata (auto-included) |
Note: Classic tokens with
reposcope grant broader access than needed. For production use, fine-grained tokens with minimal permissions are recommended.
Adding the Token to Django
- Navigate to Django Admin → Issue Capture Settings
- Enter your GitHub repository in the format
owner/repo(e.g.,octocat/hello-world) - Paste your Personal Access Token in the GitHub API key field
- Save the settings
Environment Variables (Production)
For production, use environment variables:
# settings.py
from django.conf import settings
# Override singleton defaults with env vars
ISSUE_CAPTURE_LLM_API_KEY = os.getenv("ISSUE_CAPTURE_LLM_API_KEY")
ISSUE_CAPTURE_GITHUB_API_KEY = os.getenv("GITHUB_API_KEY")
Usage
Create Issue via UI
- Navigate to
/issues/create/ - Choose creation mode:
- Standard Form: Manual entry with all fields
- AI Quick Generate: One-shot AI enhancement from basic input
Promote to GitHub
- View issues at
/issues/list/ - Click issue to view details
- Click "Promote to GitHub" (or use admin interface)
Admin Interface
The Django admin provides:
- Issue management with status tracking
- One-click GitHub promotion (HTMX-powered)
- Template configuration
Development
# Clone and install
git clone https://github.com/directory-platform/django-issue-capture
cd django-issue-capture
uv sync --extra dev
# Run tests
PYTHONPATH=. uv run python tests/manage.py test
# Run quality checks
ruff check src/ tests/
ruff format src/ tests/
mypy src/
Dependencies
- Django ≥ 4.2
- django-solo ≥ 2.0
- shortuuid ≥ 1.0
- requests ≥ 2.32
- litellm ≥ 1.70
- django-markdownify ≥ 0.9
License
MIT License - see LICENSE file for details.
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
Releasing
See RELEASING.md for instructions on publishing new versions to PyPI.
Support
- Issues: https://github.com/directory-platform/django-issue-capture/issues
- Docs: https://github.com/directory-platform/django-issue-capture
Credits
Part of the Directory Platform ecosystem. Extracted from directory-builder.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_issue_capture-0.2.0.tar.gz.
File metadata
- Download URL: django_issue_capture-0.2.0.tar.gz
- Upload date:
- Size: 38.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77df03c80342c5ece1aefd5ea056979591d79322013e87fe7d389dffc72c13fc
|
|
| MD5 |
44644703e4a0d555d31e10cbddb54800
|
|
| BLAKE2b-256 |
b57d7da4f388fc4941e0f541bab191b879c127e4b84f622dfe4d93c5aa00bb1b
|
Provenance
The following attestation bundles were made for django_issue_capture-0.2.0.tar.gz:
Publisher:
publish.yml on heysamtexas/django-issue-capture
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_issue_capture-0.2.0.tar.gz -
Subject digest:
77df03c80342c5ece1aefd5ea056979591d79322013e87fe7d389dffc72c13fc - Sigstore transparency entry: 728942434
- Sigstore integration time:
-
Permalink:
heysamtexas/django-issue-capture@7c98c9f285bc971c3e18ea9d0b0ae1f831b3ead3 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/heysamtexas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7c98c9f285bc971c3e18ea9d0b0ae1f831b3ead3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file django_issue_capture-0.2.0-py3-none-any.whl.
File metadata
- Download URL: django_issue_capture-0.2.0-py3-none-any.whl
- Upload date:
- Size: 39.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f39d34c2aad0ac9c9be3b82563c0c2b4cf2d4453ccc788f43e67e48c50adad59
|
|
| MD5 |
38a1a2bc88791890ff1b38b2f805bde5
|
|
| BLAKE2b-256 |
1d97dd1002a91a95758b27ee0758cc363b6cabe99cc56bb6535598c074e067f8
|
Provenance
The following attestation bundles were made for django_issue_capture-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on heysamtexas/django-issue-capture
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_issue_capture-0.2.0-py3-none-any.whl -
Subject digest:
f39d34c2aad0ac9c9be3b82563c0c2b4cf2d4453ccc788f43e67e48c50adad59 - Sigstore transparency entry: 728942440
- Sigstore integration time:
-
Permalink:
heysamtexas/django-issue-capture@7c98c9f285bc971c3e18ea9d0b0ae1f831b3ead3 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/heysamtexas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7c98c9f285bc971c3e18ea9d0b0ae1f831b3ead3 -
Trigger Event:
release
-
Statement type: