Skip to content

gesiscss/binder_gallery

Repository files navigation

Binder Gallery

Binder Gallery for GESIS Notebooks

Run the gallery locally

  1. Clone the repository and get into it

    git clone https://github.com/gesiscss/binder_gallery.git
    cd binder_gallery
  2. Create and activate a virtual environment with python version at least 3.7.

  3. Install dependencies:

    pip install -r dev_requirements.txt
  4. Set required environment variables

    export FLASK_APP=binder_gallery
    export FLASK_ENV=development
    # for windows
    set FLASK_APP=binder_gallery
    set FLASK_ENV=development
  5. Create a local sqlite3 db and apply migrations

    python manage.py db upgrade
  6. Run the application

    flask run

Create user

  1. With create-user command:

    flask create-user <name> <password>
  2. With flask shell:

    2.1. Start a flask shell

    flask shell

    2.2. Run this code to create a user:

    from binder_gallery.models import User
    User.create_user("name", "password")

To have custom configuration

  1. Create a config file local_config.py under project folder binder_gallery

  2. Put your custom configuration:

from config import Config as BaseConfig


class Config(BaseConfig):
    # add your custom configuration here
  1. Define the env variable for custom config:
export BG_APPLICATION_SETTINGS=local_config.Config
# for windows
set BG_APPLICATION_SETTINGS=local_config.Config

TODOs

  1. Remove GESIS related parts (templates, static files...)?

Funded by the German Research Foundation (DFG). FKZ/project number: 324867496.