A modern, enterprise-ready business intelligence web application
—
Comprehensive configuration system with settings for database connections, security, caching, feature flags, UI customization, and performance tuning. Supports environment-based configuration, runtime customization, and extensible plugin architecture for enterprise deployments.
Fundamental application configuration parameters for basic operation and identification.
VERSION_STRING: str
"""
Superset version from package.json.
Used for display in UI and API responses.
"""
SECRET_KEY: str
"""
Flask secret key for session management and CSRF protection.
Must be set to a secure random value in production.
Required for secure cookie signing and session encryption.
"""
SQLALCHEMY_DATABASE_URI: str
"""
Main database connection string for Superset metadata.
Supports PostgreSQL, MySQL, SQLite, and other SQLAlchemy backends.
Examples:
- PostgreSQL: 'postgresql://user:pass@localhost/superset'
- MySQL: 'mysql://user:pass@localhost/superset'
- SQLite: 'sqlite:///path/to/superset.db'
"""
DATA_DIR: str
"""
Superset data directory path for file storage.
Contains uploaded files, temporary data, and application assets.
"""
DEBUG: bool
"""
Flask debug mode flag for development.
Enables detailed error pages and auto-reload functionality.
Should be False in production environments.
"""
FLASK_USE_RELOAD: bool
"""
Auto-reload server on code changes during development.
Works in conjunction with DEBUG mode.
"""Configuration parameters for query performance, result limits, and resource management.
ROW_LIMIT: int = 50000
"""
Maximum rows for database queries.
Global limit applied to prevent excessive resource consumption.
"""
VIZ_ROW_LIMIT: int = 10000
"""
Maximum rows for visualization rendering.
Separate limit for chart data to ensure UI responsiveness.
"""
FILTER_SELECT_ROW_LIMIT: int = 10000
"""
Maximum rows for filter dropdown population.
Limits the number of distinct values shown in filter controls.
"""
SQL_MAX_ROW: int = 100000
"""
Maximum rows for asynchronous SQL query results.
Applies to SQL Lab queries executed in background.
"""
DISPLAY_MAX_ROW: int = 1000
"""
Frontend display limit for result tables.
Maximum rows shown in UI without pagination.
"""
MAX_TABLE_NAMES: int = 3000
"""
SQL Lab table dropdown limit.
Maximum number of tables shown in schema browser.
"""Web server settings for network binding, performance, and worker management.
SUPERSET_WEBSERVER_ADDRESS: str = '0.0.0.0'
"""
Server bind address for HTTP listener.
Use '0.0.0.0' for all interfaces or specific IP for restricted access.
"""
SUPERSET_WEBSERVER_PORT: int = 8088
"""
HTTP server port number.
Default port for Superset web interface.
"""
SUPERSET_WEBSERVER_TIMEOUT: int = 60
"""
HTTP request timeout in seconds.
Maximum time allowed for request processing.
"""
SUPERSET_WORKERS: int = 2
"""
Number of Gunicorn worker processes.
Should be adjusted based on CPU cores and expected load.
"""
SUPERSET_CELERY_WORKERS: int = 32
"""
Number of Celery worker processes for async tasks.
Used for background query processing and task execution.
"""Security settings for authentication, CSRF protection, and access control.
WTF_CSRF_ENABLED: bool = True
"""
Enable CSRF protection for forms and API endpoints.
Provides protection against cross-site request forgery attacks.
"""
WTF_CSRF_EXEMPT_LIST: list
"""
List of endpoints exempt from CSRF protection.
Typically includes API endpoints with token-based authentication.
"""
WTF_CSRF_TIME_LIMIT: int = 604800 # 7 days
"""
CSRF token expiration time in seconds.
Tokens must be refreshed after this period.
"""
AUTH_TYPE: int
"""
Authentication method configuration.
Options:
- AUTH_DB: Database-based authentication (default)
- AUTH_LDAP: LDAP/Active Directory integration
- AUTH_OAUTH: OAuth 2.0 provider authentication
- AUTH_OID: OpenID Connect authentication
- AUTH_REMOTE_USER: Header-based external authentication
"""
CUSTOM_SECURITY_MANAGER: class
"""
Custom security manager class for specialized access control.
Allows override of default permission and authentication logic.
"""Database connection settings and SQLAlchemy configuration parameters.
SQLALCHEMY_TRACK_MODIFICATIONS: bool = False
"""
SQLAlchemy modification tracking flag.
Should be False to avoid memory overhead in production.
"""
SQLALCHEMY_CUSTOM_PASSWORD_STORE: callable
"""
Custom password storage function for database connections.
Enables integration with external secret management systems.
"""
DEFAULT_DB_ID: int
"""
Default database identifier for SQL Lab.
Used when no specific database is selected.
"""
QUERY_SEARCH_LIMIT: int = 1000
"""
Maximum number of queries returned in search results.
Limits query history and search result sizes.
"""Toggle switches for enabling or disabling specific application features.
FEATURE_FLAGS: dict
"""
Dictionary of feature toggle configurations.
Enables selective feature activation for testing and gradual rollouts.
Example:
{
'ENABLE_TEMPLATE_PROCESSING': True,
'DASHBOARD_NATIVE_FILTERS': True,
'VERSIONED_EXPORT': False
}
"""
ENABLE_JAVASCRIPT_CONTROLS: bool = False
"""
Allow JavaScript in visualization controls.
Security consideration - enables custom JS in charts.
"""
ENABLE_ACCESS_REQUEST: bool = False
"""
Enable datasource access request workflow.
Allows users to request access to restricted datasources.
"""
PUBLIC_ROLE_LIKE_GAMMA: bool = False
"""
Grant Gamma-like permissions to public role.
Enables anonymous access to dashboards and data.
"""
ENABLE_CORS: bool = False
"""
Enable Cross-Origin Resource Sharing (CORS).
Required for cross-domain API access from external applications.
"""
ENABLE_PROXY_FIX: bool = False
"""
Enable proxy header processing.
Required when running behind reverse proxies or load balancers.
"""
ENABLE_CHUNK_ENCODING: bool = False
"""
Enable HTTP chunked transfer encoding.
Improves streaming performance for large responses.
"""
ENABLE_TIME_ROTATE: bool = False
"""
Enable log file rotation based on time.
Prevents log files from growing indefinitely.
"""
ENABLE_FLASK_COMPRESS: bool = True
"""
Enable HTTP response compression.
Reduces bandwidth usage and improves load times.
"""Caching system settings for performance optimization and result storage.
CACHE_DEFAULT_TIMEOUT: int = 86400 # 24 hours
"""
Default cache timeout in seconds.
Applied to cached queries and metadata.
"""
CACHE_CONFIG: dict
"""
Main application cache configuration.
Example Redis configuration:
{
'CACHE_TYPE': 'redis',
'CACHE_REDIS_URL': 'redis://localhost:6379/0',
'CACHE_DEFAULT_TIMEOUT': 3600
}
Example Memcached configuration:
{
'CACHE_TYPE': 'memcached',
'CACHE_MEMCACHED_SERVERS': ['127.0.0.1:11211']
}
"""
TABLE_NAMES_CACHE_CONFIG: dict
"""
Specialized cache configuration for database metadata.
Separate cache for table names and schema information.
Example:
{
'CACHE_TYPE': 'simple',
'CACHE_DEFAULT_TIMEOUT': 300
}
"""
RESULTS_BACKEND: dict
"""
Configuration for asynchronous query result storage.
Used for storing large query results from SQL Lab.
Example Redis backend:
{
'cache_type': 'redis',
'cache_key_prefix': 'superset_results',
'cache_redis_url': 'redis://localhost:6379/1'
}
"""Language and localization settings for multi-language support.
BABEL_DEFAULT_LOCALE: str = 'en'
"""
Default language locale for the application.
Used when user language preference is not available.
"""
BABEL_DEFAULT_FOLDER: str
"""
Directory path for translation files.
Contains .po and .mo files for supported languages.
"""
LANGUAGES: dict
"""
Supported language configurations.
Example:
{
'en': {'flag': 'us', 'name': 'English'},
'es': {'flag': 'es', 'name': 'Spanish'},
'fr': {'flag': 'fr', 'name': 'French'},
'zh': {'flag': 'cn', 'name': 'Chinese'}
}
"""Settings for file upload functionality and CSV data import capabilities.
UPLOAD_FOLDER: str
"""
Base directory for file uploads.
All uploaded files are stored in subdirectories under this path.
"""
IMG_UPLOAD_FOLDER: str
"""
Specific directory for image uploads.
Used for custom logos, icons, and visualization assets.
"""
IMG_UPLOAD_URL: str
"""
URL path for serving uploaded images.
Maps to the IMG_UPLOAD_FOLDER for web access.
"""
ALLOWED_EXTENSIONS: set = {'csv'}
"""
Set of allowed file extensions for uploads.
Controls which file types can be uploaded to Superset.
"""
CSV_EXPORT: dict
"""
CSV export format configuration.
Example:
{
'encoding': 'utf-8',
'delimiter': ',',
'line_terminator': '\n',
'quote_char': '"'
}
"""SMTP settings for email notifications and alert delivery.
EMAIL_NOTIFICATIONS: bool = False
"""
Enable email notification system.
Required for sending dashboard alerts and reports.
"""
SMTP_HOST: str = 'localhost'
"""
SMTP server hostname or IP address.
Mail server for sending outbound notifications.
"""
SMTP_PORT: int = 25
"""
SMTP server port number.
Standard ports: 25 (plain), 587 (STARTTLS), 465 (SSL).
"""
SMTP_USER: str
"""
SMTP authentication username.
Required for authenticated mail servers.
"""
SMTP_PASSWORD: str
"""
SMTP authentication password.
Should be stored securely, preferably as environment variable.
"""
SMTP_MAIL_FROM: str
"""
Default sender email address.
Used as the 'From' address for all outbound emails.
"""
SMTP_STARTTLS: bool = True
"""
Enable STARTTLS encryption for SMTP connections.
Provides security for mail transmission.
"""
SMTP_SSL: bool = False
"""
Enable SSL/TLS encryption for SMTP connections.
Alternative to STARTTLS for secure mail delivery.
"""Apache Druid integration settings for real-time analytics capabilities.
DRUID_IS_ACTIVE: bool = True
"""
Enable Druid connector and functionality.
Controls availability of Druid datasources in the application.
"""
DRUID_TZ: str = 'UTC'
"""
Default timezone for Druid queries.
Used for time-based operations and aggregations.
"""
DRUID_ANALYSIS_TYPES: list = ['cardinality']
"""
Enabled Druid analysis types for metadata discovery.
Controls which analysis operations are available.
"""
DRUID_DATA_SOURCE_BLACKLIST: list
"""
List of Druid datasources to exclude from Superset.
Prevents access to specified datasources.
"""Extended configuration options for customization and integration.
TIME_GRAIN_BLACKLIST: list
"""
Disabled time grain options across all databases.
Removes specific time grouping options from UI.
"""
TIME_GRAIN_ADDONS: dict
"""
Additional custom time grain definitions.
Extends built-in time grouping options.
"""
TIME_GRAIN_ADDON_FUNCTIONS: dict
"""
Implementation functions for custom time grains.
Maps addon names to SQL generation functions.
"""
VIZ_TYPE_BLACKLIST: list
"""
Disabled visualization types.
Removes specific chart types from creation interface.
"""
DEFAULT_MODULE_DS_MAP: dict
"""
Default datasource module mappings.
Associates datasource types with implementation modules.
"""
ADDITIONAL_MODULE_DS_MAP: dict
"""
Additional custom datasource modules.
Enables registration of custom datasource types.
"""
ADDITIONAL_MIDDLEWARE: list
"""
Custom Flask middleware classes.
Allows insertion of custom request/response processing.
"""
BLUEPRINTS: list
"""
Custom Flask blueprint registrations.
Enables addition of custom URL routes and views.
"""
HTTP_HEADERS: dict
"""
Default HTTP headers for all responses.
Commonly used for security headers and CORS configuration.
"""
CORS_OPTIONS: dict
"""
Cross-Origin Resource Sharing configuration.
Detailed CORS policy settings for API access.
"""
MAPBOX_API_KEY: str
"""
Mapbox API key for map visualizations.
Required for Mapbox-based geographic visualizations.
"""
JINJA_CONTEXT_ADDONS: dict
"""
Additional Jinja template context variables.
Extends templating capabilities with custom functions.
"""
ROBOT_PERMISSION_ROLES: list
"""
Roles managed by API/automation systems.
Prevents manual modification of automated role assignments.
"""
FLASK_APP_MUTATOR: callable
"""
Application customization function.
Called during Flask app initialization for custom setup.
"""
DB_CONNECTION_MUTATOR: callable
"""
Database connection customization function.
Modifies database connections before use.
"""
SQL_QUERY_MUTATOR: callable
"""
SQL query modification function.
Allows custom query rewriting and enhancement.
"""# config.py
SECRET_KEY = 'your-secret-key'
SQLALCHEMY_DATABASE_URI = 'postgresql://user:pass@localhost/superset'
# Development settings
DEBUG = True
FLASK_USE_RELOAD = True
# Performance tuning
ROW_LIMIT = 25000
VIZ_ROW_LIMIT = 5000# Production config with Redis caching
CACHE_CONFIG = {
'CACHE_TYPE': 'redis',
'CACHE_REDIS_URL': 'redis://redis-server:6379/0',
'CACHE_DEFAULT_TIMEOUT': 3600
}
# Multi-worker setup
SUPERSET_WORKERS = 8
SUPERSET_CELERY_WORKERS = 16
# Security hardening
WTF_CSRF_ENABLED = True
ENABLE_CORS = False# Enable experimental features
FEATURE_FLAGS = {
'DASHBOARD_NATIVE_FILTERS': True,
'ENABLE_TEMPLATE_PROCESSING': True,
'VERSIONED_EXPORT': True
}
# Custom visualization blacklist
VIZ_TYPE_BLACKLIST = ['iframe', 'markup']import os
# Use environment variables
SECRET_KEY = os.environ.get('SUPERSET_SECRET_KEY')
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
REDIS_URL = os.environ.get('REDIS_URL', 'redis://localhost:6379/0')
CACHE_CONFIG = {
'CACHE_TYPE': 'redis',
'CACHE_REDIS_URL': REDIS_URL
}The configuration system provides comprehensive control over all aspects of Superset operation, enabling deployment in diverse environments from development to large-scale enterprise production systems.
Install with Tessl CLI
npx tessl i tessl/pypi-superset