Documentation
Django Revolution
v1.0.13
Troubleshooting - Django Revolution
Installation Issues
ImportError: No module named 'django_revolution'
Problem: Django Revolution is not installed or not in Python path.
Solution:
# Install Django Revolutionpip install django-revolution# Verify installationpython -c "import django_revolution; print('✅ Installed')"# Check versionpython -c "import django_revolution; print(django_revolution.__version__)"
ModuleNotFoundError: No module named 'django_filters'
Problem: Missing dependencies.
Solution:
# Install missing dependenciespip install django-filter djangorestframework-simplejwt# Or let Django Revolution install thempython manage.py revolution --install-deps# Or install from requirementspip install -r requirements.txt
TOML Parsing Issues
Problem: ModuleNotFoundError: No module named 'toml'
or tomllib
.
Solution:
# Install toml packagepip install toml# Or install development dependenciespip install -r requirements-dev.txt# The script automatically handles both tomllib (Python 3.11+) and toml package
Configuration Issues
Zone Configuration Error
Problem: Invalid zone configuration in settings.
Solution:
# settings.py - Correct format with Pydantic modelsfrom django_revolution.app_config import ZoneConfig, get_revolution_configzones = {'public': ZoneConfig(apps=['accounts', 'billing'], # List of appstitle='Public API',description='Public endpoints',public=True,auth_required=False,version='v1')}DJANGO_REVOLUTION = get_revolution_config(project_root=BASE_DIR,zones=zones,debug=DEBUG)
Multi-Monorepo Configuration Error
Problem: Invalid monorepo configuration in settings.
Solution:
# settings.py - Correct multi-monorepo configurationfrom django_revolution.app_config import MonorepoConfig, MonorepoSettings, get_revolution_config# Configure multiple monoreposmonorepo_settings = MonorepoSettings(enabled=True,configurations=[MonorepoConfig(name="frontend",enabled=True,path=str(BASE_DIR.parent / 'monorepo'),api_package_path='packages/api'),MonorepoConfig(name="mobile",enabled=True,path=str(BASE_DIR.parent / 'mobile-monorepo'),api_package_path='packages/api-client'),])DJANGO_REVOLUTION = get_revolution_config(project_root=BASE_DIR,zones=zones,monorepo=monorepo_settings,debug=DEBUG)
URL Integration Error
Problem: URLs not properly integrated.
Solution:
# urls.py - Correct integrationfrom django_revolution.urls_integration import add_revolution_urlsurlpatterns = [# Your existing URLs]# Add Django Revolution URLsurlpatterns = add_revolution_urls(urlpatterns)
Generation Issues
Command Not Found: revolution
Problem: Django management command not recognized.
Solution:
# Check if app is in INSTALLED_APPSpython manage.py check# Verify command existspython manage.py help | grep revolution# Reinstall if neededpip uninstall django-revolutionpip install django-revolution# Or use standalone CLIdjango-revolution --help
Zone Validation Failures
Problem: Zones fail validation during generation.
Solution:
# Validate zones with detailed outputpython manage.py revolution --validate-zones# Check specific zonepython manage.py revolution --show-urls# Test schema generationpython manage.py revolution --test-schemas# Check statuspython manage.py revolution --status
Schema Generation Errors
Problem: OpenAPI schema generation fails.
Solution:
# Test schema generationpython manage.py revolution --test-schemas# Check drf-spectacular installationpip install drf-spectacular# Verify Django settingspython manage.py check# Clean and retrypython manage.py revolution --cleanpython manage.py revolution
Development Scripts Issues
Script Permission Errors
Problem: Scripts are not executable.
Solution:
# Make scripts executablechmod +x scripts/*.py scripts/*.sh# Or run with pythonpython scripts/dev_cli.py
Import Errors in Scripts
Problem: ImportError: attempted relative import with no known parent package
.
Solution:
# Run from correct directorycd /path/to/django_revolutionpython scripts/dev_cli.py# Or install in development modepip install -e .# Use package commandsdev-cliversion-manager get
Version Management Issues
Problem: Version bumping or validation fails.
Solution:
# Check current versionpython scripts/version_manager.py get# Validate version consistencypython scripts/version_manager.py validate# Bump version with specific typepython scripts/version_manager.py bump --bump-type patch# Regenerate requirements after version bumppython scripts/version_manager.py requirements
Publishing Issues
Build Failures
Problem: Package build fails during publishing.
Solution:
# Clean old buildsrm -rf build/ dist/ *.egg-info/# Install build dependenciespip install build twine# Build manuallypython -m build# Check build artifactsls -la dist/
PyPI Upload Errors
Problem: Upload to PyPI fails.
Solution:
# Use interactive publisherpython scripts/publisher.py# Check credentialspython -m twine check dist/*# Test upload to TestPyPI firstpython -m twine upload --repository testpypi dist/*# Then upload to PyPIpython -m twine upload dist/*
Debugging
Enable Debug Mode
# Set debug environment variableexport DJANGO_REVOLUTION_DEBUG=1# Run with debug outputpython manage.py revolution --debug# Check logspython manage.py revolution --status
Check Dependencies
# Check all dependenciespython manage.py revolution --check-deps# Install missing dependenciespython manage.py revolution --install-deps# Verify Node.js installationnode --versionnpm --version
Validate Environment
# Validate entire environmentpython manage.py revolution --validate# Check Django setuppython manage.py check# Verify zone configurationpython manage.py revolution --validate-zones
Performance Issues
Slow Generation
Problem: Client generation takes too long.
Solution:
# Generate specific zones onlypython manage.py revolution --zones public# Skip archive creationpython manage.py revolution --no-archive# Use development mode for faster iterationexport DJANGO_REVOLUTION_DEBUG=1
Memory Issues
Problem: High memory usage during generation.
Solution:
# Clean up old modulespython manage.py revolution --clean# Generate zones one by onepython manage.py revolution --zones publicpython manage.py revolution --zones admin# Monitor memory usagepython manage.py revolution --status
CLI Issues
Interactive CLI Problems
Problem: Interactive CLI doesn't work properly.
Solution:
# Check questionary installationpip install questionary# Use command line mode insteadpython manage.py revolution --zones public --typescript# Or use standalone CLIdjango-revolution --zones public --typescript
Rich Output Issues
Problem: Terminal output is not formatted properly.
Solution:
# Check rich installationpip install rich# Use plain outputexport DJANGO_REVOLUTION_NO_RICH=1python manage.py revolution --status# Or use simple outputpython manage.py revolution --status --no-color
Common Error Messages
"Zone 'public' not found"
Solution: Check zone configuration in settings.py
"No apps found for zone 'public'"
Solution: Verify app names in zone configuration
"Schema generation failed"
Solution: Check drf-spectacular configuration
"Client generation failed"
Solution: Verify Node.js and npm installation
"Monorepo sync failed"
Solution: Check monorepo configuration and permissions
Getting Help
Self-Diagnosis
# Run comprehensive diagnosticspython manage.py revolution --statuspython manage.py revolution --validatepython manage.py revolution --validate-zonespython manage.py revolution --test-schemas
Log Files
# Check Django logstail -f logs/django.log# Check system logsjournalctl -u your-service -f
Community Support
Debug Information
When reporting issues, include:
# System informationpython --versiondjango-admin --versionnode --versionnpm --version# Django Revolution versionpython -c "import django_revolution; print(django_revolution.__version__)"# Configurationpython manage.py revolution --status# Error logspython manage.py revolution --debug 2>&1