mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
parent
66c2b84cb4
commit
88f4260777
@ -15,7 +15,9 @@ from dateutil import tz
|
|||||||
from flask_appbuilder.security.manager import AUTH_DB
|
from flask_appbuilder.security.manager import AUTH_DB
|
||||||
|
|
||||||
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
DATA_DIR = os.path.join(os.path.expanduser('~'), '.caravel')
|
||||||
|
if not os.path.exists(DATA_DIR):
|
||||||
|
os.makedirs(DATA_DIR)
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Caravel specific config
|
# Caravel specific config
|
||||||
@ -34,10 +36,7 @@ CUSTOM_SECURITY_MANAGER = None
|
|||||||
SECRET_KEY = '\2\1thisismyscretkey\1\2\e\y\y\h' # noqa
|
SECRET_KEY = '\2\1thisismyscretkey\1\2\e\y\y\h' # noqa
|
||||||
|
|
||||||
# The SQLAlchemy connection string.
|
# The SQLAlchemy connection string.
|
||||||
SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/caravel.db'
|
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(DATA_DIR, 'caravel.db')
|
||||||
# this is for platform specific: "nt" is for windows, "posix" is *nix (including Mac)
|
|
||||||
if os.name == "nt":
|
|
||||||
SQLALCHEMY_DATABASE_URI = 'sqlite:///c:\\tmp\\caravel.db'
|
|
||||||
# SQLALCHEMY_DATABASE_URI = 'mysql://myapp@localhost/myapp'
|
# SQLALCHEMY_DATABASE_URI = 'mysql://myapp@localhost/myapp'
|
||||||
# SQLALCHEMY_DATABASE_URI = 'postgresql://root:password@localhost/myapp'
|
# SQLALCHEMY_DATABASE_URI = 'postgresql://root:password@localhost/myapp'
|
||||||
|
|
||||||
@ -172,7 +171,7 @@ LOG_LEVEL = 'DEBUG'
|
|||||||
|
|
||||||
ENABLE_TIME_ROTATE = False
|
ENABLE_TIME_ROTATE = False
|
||||||
TIME_ROTATE_LOG_LEVEL = 'DEBUG'
|
TIME_ROTATE_LOG_LEVEL = 'DEBUG'
|
||||||
FILENAME = '/tmp/caravel.log'
|
FILENAME = os.path.join(DATA_DIR, 'caravel.log')
|
||||||
ROLLOVER = 'midnight'
|
ROLLOVER = 'midnight'
|
||||||
INTERVAL = 1
|
INTERVAL = 1
|
||||||
BACKUP_COUNT = 30
|
BACKUP_COUNT = 30
|
||||||
|
@ -136,7 +136,7 @@ of the parameters you can copy / paste in that configuration module: ::
|
|||||||
# caravel metadata (slices, connections, tables, dashboards, ...).
|
# caravel metadata (slices, connections, tables, dashboards, ...).
|
||||||
# Note that the connection information to connect to the datasources
|
# Note that the connection information to connect to the datasources
|
||||||
# you want to explore are managed directly in the web UI
|
# you want to explore are managed directly in the web UI
|
||||||
SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/caravel.db'
|
SQLALCHEMY_DATABASE_URI = 'sqlite:////path/to/caravel.db'
|
||||||
|
|
||||||
# Flask-WTF flag for CSRF
|
# Flask-WTF flag for CSRF
|
||||||
CSRF_ENABLED = True
|
CSRF_ENABLED = True
|
||||||
@ -149,7 +149,7 @@ for more information on how to configure Caravel.
|
|||||||
|
|
||||||
Please make sure to change:
|
Please make sure to change:
|
||||||
|
|
||||||
* *SQLALCHEMY_DATABASE_URI*, by default it is stored on */tmp* and so will be cleared after each boot
|
* *SQLALCHEMY_DATABASE_URI*, by default it is stored at *~/.caravel/caravel.db*
|
||||||
* *SECRET_KEY*, to a long random string
|
* *SECRET_KEY*, to a long random string
|
||||||
|
|
||||||
Database dependencies
|
Database dependencies
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from caravel.config import *
|
from caravel.config import *
|
||||||
|
|
||||||
AUTH_USER_REGISTRATION_ROLE = 'alpha'
|
AUTH_USER_REGISTRATION_ROLE = 'alpha'
|
||||||
SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/caravel_unittests.db'
|
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(DATA_DIR, 'unittests.db')
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
CARAVEL_WEBSERVER_PORT = 8081
|
CARAVEL_WEBSERVER_PORT = 8081
|
||||||
|
|
||||||
@ -9,4 +9,3 @@ CARAVEL_WEBSERVER_PORT = 8081
|
|||||||
# continuous integration
|
# continuous integration
|
||||||
if 'CARAVEL__SQLALCHEMY_DATABASE_URI' in os.environ:
|
if 'CARAVEL__SQLALCHEMY_DATABASE_URI' in os.environ:
|
||||||
SQLALCHEMY_DATABASE_URI = os.environ.get('CARAVEL__SQLALCHEMY_DATABASE_URI')
|
SQLALCHEMY_DATABASE_URI = os.environ.get('CARAVEL__SQLALCHEMY_DATABASE_URI')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user