Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to save changes? #783

Closed
jalonsob opened this issue Jul 19, 2016 · 4 comments
Closed

How to save changes? #783

jalonsob opened this issue Jul 19, 2016 · 4 comments

Comments

@jalonsob
Copy link

jalonsob commented Jul 19, 2016

First, sorry for my english. I have discovered Caravel few days ago and I'm playing with it. I have installed Caravel successfully, and I have played with the examples. Now I want to save some changes but I don't know how to do it (shut down the Caravel server and then turn on again with the last changes). Do I need a caravel_config.py file in my PYTHONPATH to get it?

Some notes: I follow the next steps

# Install caravel
pip install caravel

# Create an admin user
fabmanager create-admin --app caravel

# Initialize the database
caravel db upgrade

# Create default roles and permissions
caravel init

# Load some data to play with
caravel load_examples

# Start the web server on port 8088
caravel runserver -p 8088

# To start a development web server, use the -d switch
# caravel runserver -d

When I wanna to shut down the caravel server I do ctrl+c in the shell (I use ubuntu). Then I shutdown the laptop, and when I turn on it again I lost all the last changes that I have done.

Any help?

@x4base
Copy link
Contributor

x4base commented Jul 19, 2016

See http://airbnb.io/caravel/installation.html#configuration
You have to change the path of the database

SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/caravel.db'

The path defaults to /tmp/caravel.db, which will be deleted when the server restarts
Change it to somewhere else.

@xrmx
Copy link
Contributor

xrmx commented Jul 19, 2016

@mistercrunch what do you think of updating default path to the parent dir of runcaravel or similar?

@jalonsob
Copy link
Author

So, I have to create a caravel_config.py in my PYTHONPATH (that could be "/Library/Python/2.7/", the directory where I have python installed), and then for example I create the next:


#---------------------------------------------------------
# Caravel specific config
#---------------------------------------------------------
ROW_LIMIT = 5000
CARAVEL_WORKERS = 16

CARAVEL_WEBSERVER_PORT = 8088
#---------------------------------------------------------

#---------------------------------------------------------
# Flask App Builder configuration
#---------------------------------------------------------
# Your App secret key
SECRET_KEY = '\2\1thisismyscretkey\1\2\e\y\y\h'

# The SQLAlchemy connection string to your database backend
# This connection defines the path to the database that stores your
# caravel metadata (slices, connections, tables, dashboards, ...).
# Note that the connection information to connect to the datasources
# you want to explore are managed directly in the web UI
SQLALCHEMY_DATABASE_URI = 'sqlite://///home/mylaptop/Desktop/caravel.db'

# Flask-WTF flag for CSRF
CSRF_ENABLED = True

Another question... what is the use of the secret key? It could be for example...:

SECRET_KEY = 'aaabbb123'

?

@xrmx
Copy link
Contributor

xrmx commented Jul 20, 2016

@jalonsob caravel is a flask app so general flask documentation applies here. Secret key is needed for sessions http://flask.pocoo.org/docs/0.11/quickstart/#sessions

zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 17, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 24, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 25, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants