A comprehensive Customer Relationship Management software built on Django with extensive customization capabilities
Command-line interface for Creme CRM administration, including server management, database operations, user management, and system maintenance tasks.
Primary command-line interface for all administrative tasks.
def execute():
"""
Main Django management command executor for Creme CRM.
Sets up Django environment and executes management commands.
Environment Variables:
- DJANGO_SETTINGS_MODULE: Django settings module (defaults to 'creme.settings')
- COVERAGE_PROCESS_START: Enable coverage tracking for parallel test runs
Usage Examples:
creme runserver 8000
creme migrate
creme collectstatic
creme creme_populate
The function handles:
- Setting up Python path
- Configuring Django settings
- Coverage tracking setup for tests
- Command line argument processing
"""Essential database and system management commands.
# Database initialization and population
def creme_populate(**options):
"""
Initialize database with default data, users, and configuration.
Parameters:
- verbosity: int, output verbosity level (0-3)
- interactive: bool, prompt for user input
- skip_checks: bool, skip system checks
Creates:
- Default user roles and permissions
- Core relation types and property types
- Default currencies and VAT rates
- System configuration entries
- Sample data (optional)
"""
def creme_createstaffuser(**options):
"""
Create administrative staff user accounts.
Parameters:
- username: str, username for new staff user
- email: str, email address for user
- password: str, password (prompts if not provided)
- role: str, role name to assign to user
Features:
- Interactive prompts for missing information
- Password validation
- Automatic staff and superuser flag setting
- Role assignment integration
"""
def creme_start_project(**options):
"""
Initialize new Creme CRM project structure.
Parameters:
- project_name: str, name of new project
- template: str, project template to use
- destination: str, target directory
Creates:
- Project directory structure
- Settings files
- URL configuration
- Initial migrations
- Static files setup
"""
def creme_uninstall(**options):
"""
Remove application modules and associated data.
Parameters:
- app_labels: list, application names to remove
- force: bool, skip confirmation prompts
- keep_data: bool, preserve database tables
Operations:
- Remove app from INSTALLED_APPS
- Delete migrations (optional)
- Remove database tables (optional)
- Clean up static files
"""
def creme_job_manager(**options):
"""
Background job management and monitoring.
Parameters:
- action: str, management action (start, stop, status, clear)
- job_id: str, specific job to manage
- queue: str, job queue to operate on
Actions:
- start: Start job processing
- stop: Stop job processing
- status: Show job queue status
- clear: Remove completed/failed jobs
- restart: Restart job processing
"""Commands for development, testing, and system maintenance.
def build_secret_key(**options):
"""
Generate Django SECRET_KEY for production deployment.
Parameters:
- length: int, key length (default: 50)
- output: str, output file path
Returns:
str: Generated secret key using cryptographically secure random generator
Usage:
creme build_secret_key --output=.env
creme build_secret_key --length=100
"""
def entity_factory(**options):
"""
Create test entities for development and testing.
Parameters:
- entity_type: str, type of entities to create
- count: int, number of entities to generate
- user: str, username to assign as owner
- random_data: bool, use random data generation
Supports:
- Contact and Organization generation
- Activity and event creation
- Document and folder structures
- Product and service catalogs
- Realistic fake data generation
"""Commands for translation and localization management.
def i18n_duplicates(**options):
"""
Find duplicate translation strings across language files.
Parameters:
- locale: str, specific locale to check
- output_format: str, output format (text, json, csv)
Reports:
- Identical translations in different contexts
- Potential consolidation opportunities
- Translation consistency issues
"""
def i18n_empty(**options):
"""
Find empty or missing translations in language files.
Parameters:
- locale: str, specific locale to check
- fix: bool, automatically remove empty entries
Identifies:
- Empty translation strings
- Missing translations
- Untranslated strings
"""
def i18n_overload(**options):
"""
Manage translation overrides for customization.
Parameters:
- locale: str, target locale
- key: str, translation key to override
- value: str, new translation value
Features:
- Custom translation management
- Override system translations
- Maintain upgrade compatibility
"""
def i18n_plural_forms(**options):
"""
Validate plural form expressions in translation files.
Parameters:
- locale: str, specific locale to validate
Checks:
- Plural form syntax correctness
- Language-specific plural rules
- Consistency across translation files
"""
def i18n_spellcheck(**options):
"""
Spell check translation strings using dictionaries.
Parameters:
- locale: str, target locale for checking
- dictionary: str, custom dictionary file
- ignore_words: list, words to ignore
Features:
- Multiple language support
- Custom dictionary integration
- Exclude technical terms
- Generate correction suggestions
"""Commands for specific application modules and features.
def activities_create_default_calendars(**options):
"""
Create default calendar structure for activities module.
Parameters:
- user: str, username to assign calendars to
- team_calendars: bool, create team calendars
Creates:
- Personal calendars for users
- Team/shared calendars
- Default calendar colors and settings
- Calendar permission structure
"""
def crudity_action_factory(**options):
"""
Create CRUD actions for external data import system.
Parameters:
- entity_type: str, target entity type
- source: str, data source configuration
- mapping: str, field mapping definition
Features:
- Automated data import rules
- Field mapping configuration
- Data validation rules
- Error handling setup
"""
def geolocation(**options):
"""
Manage geolocation data and address geocoding.
Parameters:
- action: str, operation to perform (update, import, export)
- provider: str, geocoding service provider
- batch_size: int, processing batch size
Operations:
- Geocode existing addresses
- Import geographic data
- Update location coordinates
- Manage map service integration
"""# Start development server
from creme.manage import execute
import sys
sys.argv = ['creme', 'runserver', '8000']
execute()
# Run database migrations
sys.argv = ['creme', 'migrate']
execute()
# Collect static files
sys.argv = ['creme', 'collectstatic', '--noinput']
execute()# Initialize database with default data
sys.argv = ['creme', 'creme_populate', '--verbosity=2']
execute()
# Create admin user
sys.argv = ['creme', 'creme_createstaffuser']
execute() # Will prompt for username, email, password
# Create user with specific role
sys.argv = ['creme', 'creme_createstaffuser',
'--username=admin', '--email=admin@example.com',
'--role=Administrator']
execute()# Start job processing
sys.argv = ['creme', 'creme_job_manager', 'start']
execute()
# Check job queue status
sys.argv = ['creme', 'creme_job_manager', 'status']
execute()
# Clear completed jobs
sys.argv = ['creme', 'creme_job_manager', 'clear', '--completed']
execute()# Generate test data
sys.argv = ['creme', 'entity_factory', '--entity_type=Contact', '--count=100']
execute()
# Generate secret key
sys.argv = ['creme', 'build_secret_key', '--length=50']
execute()
# Check translations
sys.argv = ['creme', 'i18n_empty', '--locale=fr']
execute()# Django settings module (optional, has default)
os.environ['DJANGO_SETTINGS_MODULE'] = 'creme.settings'
# Database configuration (in settings or environment)
os.environ['DATABASE_URL'] = 'postgresql://user:pass@localhost/creme_db'
# Redis configuration for job queue
os.environ['REDIS_URL'] = 'redis://localhost:6379/0'
# Media and static files
os.environ['MEDIA_ROOT'] = '/var/creme/media'
os.environ['STATIC_ROOT'] = '/var/creme/static'# Coverage tracking for tests
os.environ['COVERAGE_PROCESS_START'] = '.coveragerc'
# Debug mode
os.environ['DEBUG'] = 'True'
# Email configuration
os.environ['EMAIL_HOST'] = 'smtp.example.com'
os.environ['EMAIL_PORT'] = '587'
os.environ['EMAIL_HOST_USER'] = 'noreply@example.com'
os.environ['EMAIL_HOST_PASSWORD'] = 'password'The console interface integrates with system package managers and deployment tools:
# Install and initialize
pip install creme-crm
creme migrate
creme creme_populate
creme creme_createstaffuser
# Start server
creme runserver 0.0.0.0:8000
# Production deployment
creme collectstatic --noinput
creme migrate --run-syncdb
creme creme_job_manager start
# Maintenance tasks
creme clearsessions
creme cleanup_files
creme i18n_duplicates --locale=allInstall with Tessl CLI
npx tessl i tessl/pypi-creme-crmdocs