Reusable, extensible Django applications for common functionality.
HTK provides 29 pre-built apps organized by feature:
- User Management - Accounts, profiles, email management
- Social & Authentication - OAuth, social auth backends
- Organization & Teams - Multi-org support, permissions, invitations
- Payments & Commerce - Stripe, subscriptions, quotes, invoices
- Communication - Messaging, conversations, notifications
- Content & Knowledge - Bible, forums, feedback
- Data Management - Files, storage, key-value storage
- Utilities - Async tasks, features, changelog, documentation
New multi-model Django apps should prefer a models/ package with one focused model file per model, an explicit models/__init__.py that re-exports public models, and a short models/README.md. This keeps reusable apps reviewable while preserving imports such as from htk.apps.example.models import Thing.
User registration, authentication, and profile management.
Key Features:
- User registration and email verification
- Email management (multiple emails per user)
- Token-based authentication
- User profiles with timezone and locale
- Social auth integration (OAuth, OAuth2)
- Password reset and recovery
- User search and lookup
Usage:
from htk.apps.accounts.utils.general import create_user, get_user_by_email
user = create_user('user@example.com', password='secure')
user = get_user_by_email('user@example.com')Models:
BaseAbstractUserProfile- Extend for custom user profilesUserEmail- Multiple emails per user- Django's built-in
Usermodel
Postal address management and geocoding.
Key Features:
- Store and manage postal addresses
- Google Maps integration for address geocoding
- Latitude/longitude storage
HTK supports social authentication through python-social-auth:
- Facebook, Twitter, Google, LinkedIn
- Withings (health data)
- Custom OAuth2 backends
Multi-organization support with role-based access control.
Key Features:
- Create organizations with members
- Role-based permissions (owner, member, etc.)
- Organization invitations
- Member management
- Organization-specific settings
Usage:
from htk.apps.organizations.models import BaseOrganization
org = BaseOrganization.objects.create(name='Acme Corp')
org.invite_member('user@example.com', role='member')Handle user invitations for onboarding and access control.
Key Features:
- Invitation creation and tracking
- Email-based invitations
- Invitation expiration
- Integration with user onboarding
Full Stripe integration for payments and subscriptions.
Key Features:
- Stripe customer creation and management
- Credit card handling
- One-time charges and payments
- Recurring subscriptions
- Invoice generation
Usage:
from htk.apps.stripe_lib.models import BaseStripeCustomer
customer = BaseStripeCustomer.objects.create(user=user, stripe_id='cus_xxx')
customer.charge(amount, stripe_token)
subscription = customer.create_subscription(plan_id)Quoting and invoicing system.
Key Features:
- Create quotes for customers
- Line items and pricing
- Group quotes
- Invoice generation
- Payment tracking
Customer management for commerce apps.
E-commerce and store functionality.
Send notifications via multiple channels.
Key Features:
- Email notifications
- Slack integration
- Notification history and tracking
User-to-user messaging and conversations.
Key Features:
- Create conversations between users
- Message threads with participants
- Emoji reactions to messages
- Conversation history
Usage:
from htk.apps.conversations.models import BaseConversation
convo = BaseConversation.objects.create()
convo.add_participants(user1, user2)
convo.add_message(user1, 'Hello!')Discussion forums and message threads.
Key Features:
- Create forums
- Forum threads and messages
- Tags for categorization
- Thread tracking
Scripture data and reference tools.
Key Features:
- Bible books, chapters, verses
- Scripture passage lookup
- Bible reference formatting
Collect user feedback and reviews.
Store uploaded files.
Key Features:
- Handle file uploads
- Store files securely
- File organization
Binary large object (BLOB) storage.
Key-value storage for flexible data.
Usage:
from htk.apps.kv_storage.utils import kv_put, kv_get
kv_put('user:settings', {'theme': 'dark'})
settings = kv_get('user:settings')Feature flags for gradual rollouts.
Key Features:
- Enable/disable features per user or org
- A/B testing support
- Feature flag caching
Usage:
from htk.apps.features.utils import get_feature_flag
if get_feature_flag('new_dashboard', user):
# Show new dashboardEnable maintenance mode to prevent user access.
Key Features:
- Global maintenance mode toggle
- Exception list for admin access
Pre-launch signup and early access management.
REST API utilities and tools. See api/README.md.
Automatic README generation for modules.
Key Features:
- Analyze Python modules
- Generate documentation
- Extract classes, functions, models
Track and generate changelogs from Git history.
Internationalization and localization tools.
Key Features:
- Multi-language string support
- Localizable and localized strings
- Language detection
Multi-site support (Django contrib wrapper).
Mobile app integration and push notifications.
Performance optimization through materialized properties.
API token management and authentication.
Create and manage short URLs.
Usage:
from htk.apps.url_shortener.models import HTKShortUrl
short = HTKShortUrl.objects.create(url='https://very-long-url.com')
short_code = short.code # e.g., 'a7f2'Extend abstract models to add custom fields:
from htk.apps.accounts.models import BaseAbstractUserProfile
class CustomUserProfile(BaseAbstractUserProfile):
organization = ForeignKey(Organization)
department = CharField(max_length=100)Leverage app mixins for common functionality:
from htk.apps.accounts.mixins import UserOwnedMixin
class MyModel(UserOwnedMixin):
# Automatically tracks owner and timestamps
passApps provide signal handlers for key events:
from htk.apps.accounts.apps import create_user_profile
# Automatically called when User is createdEnable apps in settings.py:
INSTALLED_APPS = [
'htk.apps.accounts',
'htk.apps.organizations',
'htk.apps.stripe_lib',
'htk.apps.conversations',
'htk.apps.notifications',
# ... more apps
]Each app includes migrations for easy database setup:
python manage.py migrate