First, I installed it on Ubuntu 15, which was “normal” and work okay. However, I also use Windows 7 as one of my major working environment and it is not convenient to restart/switch OS in a single command without losing all workspace. So let’s make a try of caravel on Windows 7.
On their installation instruction for windows, I copied for you to easy to see
# http://airbnb.io/caravel/installation.html C:\> \path\to\vcvarsall.bat x86_amd64 C:\> set LIB=C:\OpenSSL-1.0.1f-64bit\lib;%LIB% C:\> set INCLUDE=C:\OpenSSL-1.0.1f-64bit\include;%INCLUDE% C:\> pip install cryptography # You may also have to create C:\Temp C:\> md C:\Temp
virtualenv penv I follow the instruction in the same page like this:
# Install caravel pip install caravel # Create an admin user fabmanager create-admin --app caravel (1) # Initialize the database caravel db upgrade (2) # Create default roles and permissions caravel init (3) # Load some data to play with caravel load_examples # Start the development web server caravel runserver -d
From this one (2), there is problem, saying that sqlite cannot find the database. Ah ha, now it is the geeky time.
Luckily, I found this file (https://github.com/airbnb/caravel/blob/master/caravel/config.py), this is the happy part: 🙂
The sample database caravel.db, which is located at /tmp/caravel.db, on windows, there is no such path. This made the error about not found database. I knew caravel use SQLAlchemy by looking at carevel installation output and from the error lines, this leads me to this page http://flask-sqlalchemy.pocoo.org/2.1/config/ (Caravel uses flask – or more precisely they use flask-appbuilder).
|SQLALCHEMY_DATABASE_URI = ‘sqlite:///c:\\tmp\\caravel.db‘|
|Remember, there are 3 back lashes and \\ for windows.|
So now it works like a charm. Viola! congratuation.