feat(admin): Add API monitoring, debug console, and system health templates for enhanced admin interface docs: Add AI system cleanup summary and audit report detailing architecture, token management, and recommendations docs: Introduce credits and tokens system guide outlining configuration, data flow, and monitoring strategies
9.1 KiB
GLOBAL SETTINGS - DJANGO ADMIN ACCESS GUIDE
Last Updated: December 20, 2025
Status: ✅ READY TO USE
WHERE TO FIND GLOBAL SETTINGS IN DJANGO ADMIN
1. Global AI Integration Settings (API Keys)
URL: http://your-domain.com/admin/system/globalintegrationsettings/
What It Controls:
- OpenAI API key (for text generation)
- OpenAI model selection (gpt-4, gpt-3.5-turbo, etc.)
- OpenAI temperature and max_tokens
- DALL-E API key (for image generation)
- DALL-E model, size, quality, style
- Anthropic API key (for Claude)
- Anthropic model selection
- Runware API key (for advanced image generation)
Important:
- This is a SINGLETON - only ONE record exists (ID=1)
- Changes here affect ALL accounts by default
- Enterprise accounts can override with their own keys
How to Configure:
- Login to Django Admin as superuser
- Navigate to: System → Global integration settings
- Click on the single "Global Integration Settings" entry
- Fill in your platform-wide API keys
- Set default models and parameters
- Save
2. Account Integration Overrides (Per-Account API Keys)
URL: http://your-domain.com/admin/system/accountintegrationoverride/
What It Controls:
- Per-account API key overrides for enterprise customers
- Each account can optionally use their own keys
- Falls back to global if not configured
Fields:
- Account (select which account)
- use_own_keys (checkbox - if unchecked, uses global)
- Same API key fields as global (all optional)
How to Configure:
- Navigate to: System → Account integration overrides
- Click "Add account integration override"
- Select the account
- Check "Use own keys"
- Fill in their API keys
- Save
How It Works:
- If account has override with use_own_keys=True → uses their keys
- If account has NO override OR use_own_keys=False → uses global keys
- Account can be deleted/disabled to revert to global
3. Global AI Prompts (Prompt Templates Library)
URL: http://your-domain.com/admin/system/globalaiprompt/
What It Controls:
- Platform-wide default AI prompt templates
- Used for clustering, content generation, ideas, etc.
- All accounts can use these prompts
- Accounts can customize their own versions
Fields:
- Prompt type (clustering, ideas, content_generation, etc.)
- Prompt value (the actual prompt template)
- Description (what this prompt does)
- Variables (list of available variables like {keyword}, {industry})
- Version (for tracking changes)
- Is active (enable/disable)
How to Configure:
- Navigate to: System → Global ai prompts
- Click "Add global ai prompt"
- Select prompt type (or create new)
- Write your prompt template
- List variables it uses
- Mark as active
- Save
Account Usage:
- Accounts automatically use global prompts
- Accounts can create customized versions in their own AIPrompt records
- Accounts can reset to global anytime
4. Global Author Profiles (Persona Templates Library)
URL: http://your-domain.com/admin/system/globalauthorprofile/
What It Controls:
- Platform-wide author persona templates
- Tone of voice configurations
- Writing style templates
- Accounts can clone and customize
Fields:
- Name (e.g., "SaaS B2B Professional")
- Description (what this persona is for)
- Tone (professional, casual, technical, etc.)
- Language (en, es, fr, etc.)
- Structure template (JSON config for content structure)
- Category (saas, ecommerce, blog, technical, creative)
- Is active (enable/disable)
How to Configure:
- Navigate to: System → Global author profiles
- Click "Add global author profile"
- Create a persona template
- Set tone and language
- Add structure template if needed
- Assign category
- Save
Account Usage:
- Accounts browse global library
- Accounts clone a template to create their own version
- Cloned version stored in AuthorProfile model with cloned_from reference
- Accounts can customize their clone without affecting global
5. Global Strategies (Content Strategy Templates)
URL: http://your-domain.com/admin/system/globalstrategy/
What It Controls:
- Platform-wide content strategy templates
- Section structures for different content types
- Prompt sequences for content generation
- Accounts can clone and customize
Fields:
- Name (e.g., "SEO Blog Post Strategy")
- Description (what this strategy achieves)
- Category (blog, product, howto, comparison, etc.)
- Prompt types (which prompts to use)
- Section logic (JSON config for content sections)
- Is active (enable/disable)
How to Configure:
- Navigate to: System → Global strategies
- Click "Add global strategy"
- Create a strategy template
- Define section structure
- Specify which prompts to use
- Add section logic JSON
- Save
Account Usage:
- Similar to author profiles
- Accounts clone global templates
- Customize for their needs
- Track origin via cloned_from field
ACCOUNT-SPECIFIC MODELS (Not Global)
These remain account-specific as originally designed:
AIPrompt (Account-Level)
URL: /admin/system/aiprompt/
- Per-account AI prompt customizations
- References global prompts by default
- Can be customized (is_customized=True)
- Can reset to global anytime
AuthorProfile (Account-Level)
URL: /admin/system/authorprofile/
- Per-account author personas
- Can be cloned from global (cloned_from field)
- Can be created from scratch (is_custom=True)
Strategy (Account-Level)
URL: /admin/system/strategy/
- Per-account content strategies
- Can be cloned from global
- Can be created from scratch
IntegrationSettings (Account-Level) - DEPRECATED
URL: /admin/system/integrationsettings/ Status: This model is being phased out in favor of Global + Override pattern Do Not Use: Use GlobalIntegrationSettings and AccountIntegrationOverride instead
NAVIGATION IN DJANGO ADMIN
When you login to Django Admin, you'll see:
SYSTEM
├── Global Integration Settings (1 entry - singleton)
├── Account Integration Overrides (0+ entries - one per enterprise account)
├── Global AI Prompts (library of prompt templates)
├── Global Author Profiles (library of persona templates)
├── Global Strategies (library of strategy templates)
├── AI Prompts (per-account customizations)
├── Author Profiles (per-account personas)
├── Strategies (per-account strategies)
└── Integration Settings (DEPRECATED - old model)
QUICK START CHECKLIST
After deployment, configure in this order:
-
Set Global API Keys (/admin/system/globalintegrationsettings/)
- OpenAI API key
- DALL-E API key
- Anthropic API key (optional)
- Runware API key (optional)
- Set default models and parameters
-
Create Global Prompt Library (/admin/system/globalaiprompt/)
- Clustering prompt
- Content ideas prompt
- Content generation prompt
- Meta description prompt
- Title generation prompt
-
Create Global Author Profiles (/admin/system/globalauthorprofile/)
- Professional B2B profile
- E-commerce profile
- Blog/casual profile
- Technical profile
- Creative profile
-
Create Global Strategies (/admin/system/globalstrategy/)
- SEO blog post strategy
- Product launch strategy
- How-to guide strategy
- Comparison article strategy
-
Test with Regular Account
- Create content using global prompts
- Verify global API keys work
- Test cloning profiles/strategies
-
Configure Enterprise Account (if needed)
- Create AccountIntegrationOverride
- Add their API keys
- Enable use_own_keys
- Test their custom keys work
TROUBLESHOOTING
Problem: Can't see Global Integration Settings in admin
Solution:
- Check you're logged in as superuser
- Refresh the page
- Check URL: /admin/system/globalintegrationsettings/
- Verify migration applied:
docker exec igny8_backend python manage.py showmigrations system
Problem: Global settings not taking effect
Solution:
- Check GlobalIntegrationSettings has values saved
- Verify is_active=True
- Check no AccountIntegrationOverride for the account
- Restart backend:
docker restart igny8_backend
Problem: Account override not working
Solution:
- Check use_own_keys checkbox is enabled
- Verify API keys are filled in
- Check account selected correctly
- Test the API keys manually
API ACCESS TO GLOBAL SETTINGS
Code can access global settings:
Get Global Integration Settings:
from igny8_core.modules.system.global_settings_models import GlobalIntegrationSettings
settings = GlobalIntegrationSettings.get_instance()
Get Effective Settings for Account (checks override, falls back to global):
from igny8_core.ai.settings import get_openai_settings
settings = get_openai_settings(account)
Get Global Prompt:
from igny8_core.modules.system.global_settings_models import GlobalAIPrompt
prompt = GlobalAIPrompt.objects.get(prompt_type='clustering', is_active=True)
For complete implementation details, see COMPLETE-IMPLEMENTATION-GUIDE.md