This web application is a dashboard or view of a small Airtable database called Art Gallery. Art Gallery is a built-in sample with only two tables. One table has a list of artists, their biographies, several photos of their work, and their genres. A second table groups the artists into collections of art movements.
A python library airtable-python-wrapper by gtalarico on is used to access the Airtable API. The Gallery app doesn't do anything fancy with the API, just reads the two tables into memory, and from there uses python to manipulate the data for display.
You can demo the dashboard at my site on the PythonAnyhere host, here.
You can download and run the code on your computer. You will need:
In a previous project, I listed the steps to create a free Airtable account, and make a copy of the Art Gallery database. The steps are here.
Go to Github and either download the zipfile or clone the repo.
The zipfile will be airtable_gallery-master.zip. Unzip the file, and a new subdirectory 'airtable_gallery-master' will be created.
Create a virtual environment and install the packages. A python virtual environment is always recommended. Refer to the Virtual Environment snippet. Open a shell on the localhost to run these commands.
1 2 3 4 5 6 7 8
cd airtable_gallery-master mkvirtualenv --python=/usr/local/bin/python3 airtable_gallery # Install the libraries in requirements.txt # In virtualenv, pip will be aliased to pip3, but just in case you have # multiple pips in global path: pip3 install -r requirements.txt
Make sure to replace the App and Api keys with your own. If you are not using a mkvirtualenv virtual environment, exclude the 'workon' statement.
cd ~/titan/airtable_gallery workon airtable_gallery export FLASK_APP=app/app.py export FLASK_DEBUG=true export AIRTABLE_APP_KEY=app_YOUR_KEY_HERE export AIRTABLE_API_KEY=key_YOUR_OTHER_KEY_ALSO export WHERE_RUNNING=localhost flask run -p 9000
Point your browser to http://127.0.0.1:9000