superset/docs/installation.rst

104 lines
3.2 KiB
ReStructuredText
Raw Normal View History

2016-03-16 23:25:41 -04:00
Installation & Configuration
============================
Getting Started
---------------
2016-03-30 00:24:01 -04:00
Caravel is currently only tested using Python 2.7.*. Python 3 support is
2016-03-16 23:25:41 -04:00
on the roadmap, Python 2.6 won't be supported.
2016-03-30 00:24:01 -04:00
Follow these few simple steps to install Caravel.::
2016-03-16 23:25:41 -04:00
2016-03-30 00:24:01 -04:00
# Install caravel
pip install caravel
2016-03-16 23:25:41 -04:00
# Create an admin user
2016-03-30 00:24:01 -04:00
fabmanager create-admin --app caravel
2016-03-16 23:25:41 -04:00
# Initialize the database
2016-03-30 00:24:01 -04:00
caravel db upgrade
2016-03-16 23:25:41 -04:00
# Create default roles and permissions
2016-03-30 00:24:01 -04:00
caravel init
2016-03-16 23:25:41 -04:00
# Load some data to play with
2016-03-30 00:24:01 -04:00
caravel load_examples
2016-03-16 23:25:41 -04:00
# Start the development web server
2016-03-30 00:24:01 -04:00
caravel runserver -d
2016-03-16 23:25:41 -04:00
After installation, you should be able to point your browser to the right
hostname:port [http://localhost:8088](http://localhost:8088), login using
the credential you entered while creating the admin account, and navigate to
`Menu -> Admin -> Refresh Metadata`. This action should bring in all of
2016-03-30 00:24:01 -04:00
your datasources for Caravel to be aware of, and they should show up in
2016-03-16 23:25:41 -04:00
`Menu -> Datasources`, from where you can start playing with your data!
Configuration
-------------
To configure your application, you need to create a file (module)
2016-03-30 00:24:01 -04:00
``caravel_config.py`` and make sure it is in your PYTHONPATH. Here are some
2016-03-16 23:25:41 -04:00
of the parameters you can copy / paste in that configuration module: ::
#---------------------------------------------------------
2016-03-30 00:24:01 -04:00
# Caravel specifix config
2016-03-16 23:25:41 -04:00
#---------------------------------------------------------
ROW_LIMIT = 5000
WEBSERVER_THREADS = 8
2016-03-30 00:24:01 -04:00
CARAVEL_WEBSERVER_PORT = 8088
2016-03-16 23:25:41 -04:00
#---------------------------------------------------------
#---------------------------------------------------------
# Flask App Builder configuration
#---------------------------------------------------------
# Your App secret key
SECRET_KEY = '\2\1thisismyscretkey\1\2\e\y\y\h'
# The SQLAlchemy connection string.
2016-03-30 00:24:01 -04:00
SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/caravel.db'
2016-03-16 23:25:41 -04:00
# Flask-WTF flag for CSRF
CSRF_ENABLED = True
# Whether to run the web server in debug mode or not
DEBUG = True
This file also allows you to define configuration parameters used by
2016-03-30 00:24:01 -04:00
Flask App Builder, the web framework used by Caravel. Please consult
2016-03-16 23:25:41 -04:00
the `Flask App Builder Documentation
<http://flask-appbuilder.readthedocs.org/en/latest/config.html>`_
2016-03-30 00:24:01 -04:00
for more information on how to configure Caravel.
2016-03-16 23:25:41 -04:00
Caching
-------
2016-03-30 00:24:01 -04:00
Caravel uses `Flask-Cache <https://pythonhosted.org/Flask-Cache/>`_ for
2016-03-16 23:25:41 -04:00
caching purpose. Configuring your caching backend is as easy as providing
2016-03-30 00:24:01 -04:00
a ``CACHE_CONFIG``, constant in your ``caravel_config.py`` that
2016-03-16 23:25:41 -04:00
complies with the Flask-Cache specifications.
Flask-Cache supports multiple caching backends (Redis, Memcache,
SimpleCache (in-memory), or the local filesystem).
2016-03-30 00:24:01 -04:00
For setting your timeouts, this is done in the Caravel metadata and goes
2016-03-16 23:25:41 -04:00
up the "timeout searchpath", from your slice configuration, to your
data source's configuration, to your database's and ultimately falls back
into your global default defined in ``CACHE_CONFIG``.
Druid
-----
* From the UI, enter the information about your clusters in the
``Admin->Clusters`` menu by hitting the + sign.
* Once the Druid cluster connection information is entered, hit the
``Admin->Refresh Metadata`` menu item to populate
* Navigate to your datasources