Configuration

Learn how to configure Sand Framework for your specific needs.

Environment Variables

Core Configuration

# API Configuration
API_HOST=0.0.0.0
API_PORT=8000
DEBUG=false
ENVIRONMENT=production  # development, staging, production

# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/dbname
DATABASE_POOL_SIZE=20

# Message Broker
BROKER_URL=amqp://user:pass@rabbitmq:5672/
BROKER_POOL_LIMIT=10

AI Service Configuration

# LLM Provider Settings
LLM_PROVIDER=openai  # openai, anthropic, or deepseek
OPENAI_API_KEY=your_key_here
OPENAI_MODEL=gpt-4  # or gpt-3.5-turbo
ANTHROPIC_API_KEY=your_key_here  # Optional
DEEPSEEK_ENDPOINT=your_endpoint  # Optional

Analytics Configuration

# Social Media Integration
TWITTER_BEARER_TOKEN=your_token_here
TWITTER_QUERY_INTERVAL=300  # seconds

# Price Tracking
PRICE_UPDATE_INTERVAL=5  # seconds
PRICE_ALERT_WEBHOOK=your_webhook_url

Feature Flags

Configure features in config.yaml:

features:
  ai_copilot: true
  contract_analysis: true
  analytics: true
  discord_bot: true
  
security:
  rate_limiting: true
  jwt_auth: true
  
scaling:
  max_workers: 4
  cache_size: 1000

Logging Configuration

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
            'level': 'DEBUG',
        },
    },
    'root': {
        'handlers': ['console'],
        'level': 'DEBUG',
    },
}

Cache Configuration

CACHES = {
    'default': {
        'BACKEND': 'django_redis.cache.RedisCache',
        'LOCATION': 'redis://redis:6379/0',
        'OPTIONS': {
            'CLIENT_CLASS': 'django_redis.client.DefaultClient',
        }
    }
}

Last updated