This guide explains how to deploy and configure the WordPress-style auto-update system for your Ecom CMS.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AUTO-UPDATE ECOSYSTEM β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β Update Server β ββ β Client Sites β ββ β Admin Panel β
β β (Your Control) β β (User Install) β β (Update UI) β
β βββββββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
core/version.py- Version management and update logicupdates/- Django app for update managementversion.json- Current version tracking- Management Commands - Automated update checking
- UpdateSettings - Global update configuration
- UpdateCheck - History of update checks
- UpdateLog - Update installation logs
- AvailableUpdate - Available updates from server
- UpdateNotification - Update notifications
- Update Dashboard - Central update management
- Settings Panel - Configure auto-updates
- Version History - Track installations
- Notifications - Update alerts
Create a simple update server API that responds to update checks:
# Example update server response
{
"update_available": true,
"latest_version": "1.1.0",
"download_url": "https://your-server.com/releases/ecom-cms-1.1.0.zip",
"file_size": 15728640,
"checksum": "sha256_hash_here",
"critical": false,
"release_notes": "Bug fixes and new features",
"compatibility": {
"min_version": "1.0.0",
"php_version": "8.0",
"requires": ["django>=4.0"]
}
}Structure your update packages:
update-package.zip
βββ update_manifest.json
βββ core/
β βββ new_file.py
β βββ modified_file.py
βββ templates/
β βββ new_template.html
βββ static/
βββ updated_asset.js
update_manifest.json:
{
"version": "1.1.0",
"release_date": "2025-01-20T10:00:00Z",
"release_notes": "Description of changes",
"files": [
{"path": "core/new_file.py", "action": "update"},
{"path": "old_file.py", "action": "delete"},
{"path": "templates/new_template.html", "action": "update"}
],
"migrations": ["0002_new_migration"],
"post_update_commands": [
"collectstatic --noinput",
"migrate"
]
}Run migrations and set up the system:
# Create and apply migrations
python manage.py makemigrations updates
python manage.py migrate
# Create initial settings
python manage.py shell -c "
from updates.models import UpdateSettings
settings = UpdateSettings.get_settings()
settings.auto_check_enabled = True
settings.check_frequency = 'weekly'
settings.backup_before_update = True
settings.update_server_url = 'https://your-api.com/cms-updates'
settings.save()
print('Update settings configured')
"Add to your server's crontab:
# Check for updates daily at 2 AM
0 2 * * * cd /path/to/your/cms && python manage.py check_updates
# Check for critical updates every 6 hours
0 */6 * * * cd /path/to/your/cms && python manage.py check_updates --force
# Auto-install critical updates
0 3 * * 1 cd /path/to/your/cms && python manage.py check_updates --auto-install --notify- Login to Django Admin:
/admin/ - Navigate to "Updates" section
- Configure settings in "Update Settings"
Automatic Updates:
- β Auto-check enabled
- β° Check frequency (Daily/Weekly/Monthly)
- π Auto-install non-critical updates
- π¨ Auto-install critical security updates
Backup Settings:
- πΎ Create backup before updates
- π Maximum backups to keep
Notifications:
- π§ Email notifications
- π Admin panel notifications
- Go to Admin β Updates β Dashboard
- Click "Check for Updates"
- Review available updates
- Click "Install" for desired updates
- Monitor progress in real-time
# Check for updates
python manage.py check_updates
# Check and auto-install
python manage.py check_updates --auto-install
# Force check (ignoring settings)
python manage.py check_updates --force
# Send email notification
python manage.py check_updates --notify- All downloads verified with SHA-256
- Prevents corrupted or tampered files
- Automatic rollback on verification failure
- Automatic backup before each update
- Easy rollback to previous versions
- Configurable backup retention
- Only admin users can manage updates
- API key authentication for update server
- Secure download over HTTPS
1. Check β 2. Download β 3. Verify β 4. Backup β 5. Install β 6. Migrate β 7. Cleanup
- β Current version
- π Available updates
- π Update history
- π Notifications
- π System status
- Update checks
- Installation progress
- Success/failure status
- Error messages
- Rollback events
Update Check Fails:
# Check network connectivity
python manage.py check_updates --force
# Verify update server URL
# Check API key configurationUpdate Installation Fails:
# Check file permissions
# Verify disk space
# Review error logs in admin panelRollback Required:
# Via admin panel or:
from core.version import cms_version
cms_version.rollback('/path/to/backup.zip')- Central Update Server - Host your own update API
- License Management - Integrate with licensing system
- Staged Rollouts - Deploy to test sites first
- Usage Analytics - Track update adoption
- GitHub Releases - Use GitHub API as update server
- Docker Updates - Container-based updates
- Package Managers - pip/composer integration
- β Semantic versioning (1.2.3)
- β Detailed release notes
- β Beta testing program
- β Backward compatibility
- β Migration testing
- β Always backup before updates
- β Test on staging environment
- β Monitor after deployment
- β Have rollback plan ready
- β Communicate with users
- β Compress update packages
- β Delta updates for large changes
- β CDN for download distribution
- β Background processing
- β Progress indicators
- Plugin Updates - Separate plugin update system
- Theme Updates - Update themes independently
- Selective Updates - Choose specific components
- Update Channels - Stable/Beta/Alpha channels
- A/B Testing - Test updates on subset of users
This auto-update system provides WordPress-level ease of updates while maintaining full control and security for your CMS distribution! π