Skip to main content
Ralph provides several command-line tools for managing your Ralph installation, running development servers, and executing various operations.

Available Commands

Ralph includes the following command-line entry points:

ralph

The main production command for running Ralph.
This command uses the production settings (ralph.settings.prod) and provides access to all Django management commands. Common Usage:

dev_ralph

Development version of Ralph with development-specific settings.
This command uses development settings (ralph.settings.dev) which typically include:
  • Debug mode enabled
  • Development-specific middleware
  • Verbose logging
  • Development database settings
Example:

test_ralph

Test runner for Ralph with test-specific settings.
This command uses test settings (ralph.settings.test) and forces their use regardless of environment variables. Test settings typically include:
  • In-memory database for faster tests
  • Disabled migrations
  • Test-specific configurations
Examples:

validate_ralph

Cross-validation tool for Ralph data integrity.
This command validates data consistency across Ralph’s database, checking for:
  • Orphaned records
  • Invalid foreign key references
  • Data integrity violations
  • Configuration issues
Example:

Django Management Commands

Ralph is built on Django, so all Django management commands are available through the Ralph CLI.

Database Commands

User Management

Static Files

Database Shell

Python Shell

Ralph-Specific Commands

Ralph extends Django with custom management commands for specific operations.

LDAP Synchronization

Synchronize users from LDAP/Active Directory:
This command:
  • Connects to configured LDAP server
  • Imports users matching filter criteria
  • Updates existing user information
  • Syncs group memberships
  • Reports progress every 100 items
See the Configuration section for LDAP setup details.

OpenStack Synchronization

Sync cloud resources from OpenStack:
This command:
  • Connects to configured OpenStack instances
  • Downloads projects and instances
  • Creates/updates Cloud Projects and Cloud Hosts in Ralph
  • Deletes resources no longer in OpenStack
  • Tags resources with configured tags
See the Configuration section for OpenStack setup.

Data Import

Import data from various sources:

Environment Variables

Ralph CLI commands respect several environment variables:
string
Override the Django settings module. Default varies by command:
  • ralph: ralph.settings.prod
  • dev_ralph: ralph.settings.dev
  • test_ralph: ralph.settings.test (forced)
boolean
Enable debug mode. Not recommended for production.
string
Database connection string (e.g., mysql://user:pass@localhost/dbname)
string
Django secret key for cryptographic signing. Must be set in production.
Example:

Running in Production

Using systemd

Create a systemd service file (/etc/systemd/system/ralph.service):
Enable and start the service:

Using Supervisor

Create a supervisor config (/etc/supervisor/conf.d/ralph.conf):
Reload supervisor:

Scheduled Tasks

Use cron or systemd timers for periodic tasks:

Debugging

Enable Verbose Output

Most commands support verbosity levels:

Check Configuration

Database Queries

Monitor SQL queries during development:

Getting Help

Get help for any command: