Skip to content

Instantly share code, notes, and snippets.

@Krazybug
Last active February 28, 2022 18:17
Show Gist options
  • Select an option

  • Save Krazybug/c1bc4bc49e2a34d06279e60054cdab6b to your computer and use it in GitHub Desktop.

Select an option

Save Krazybug/c1bc4bc49e2a34d06279e60054cdab6b to your computer and use it in GitHub Desktop.

Revisions

  1. Krazybug revised this gist May 9, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    You need a recent installation of python (3.x)

    1. Install poetry, datasette and it's plugins
    1. Install poetry, datasette and its plugins

    ```
    poetry new calishot
  2. Krazybug revised this gist May 9, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # CALISHOT Deployment instructions
    # CALISHOT deployment instructions

    You need an recent instatllation of python (3.x)
    You need a recent installation of python (3.x)

    1. Install poetry, datasette and it's plugins

  3. Krazybug created this gist May 8, 2020.
    69 changes: 69 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,69 @@
    # CALISHOT Deployment instructions

    You need an recent instatllation of python (3.x)

    1. Install poetry, datasette and it's plugins

    ```
    poetry new calishot
    poetry shell
    poetry add datasette
    poetry add datasette-json-html
    poetry add datasette-pretty-json
    ```

    You can eventually install it with virtualenv/pip if you don't want to use poetry:

    ```
    python -m venv calishot
    . ./calishot/bin/activate
    pip install datasette
    pip install datasette-json-html
    pip install datasette-pretty-json
    ````
    2. Prepare the calishot settings:
    Download the sqlite db file to the same directory and then
    ```
    cat <<EOF > metadata.json
    {
    "databases": {
    "index": {
    "tables": {
    "summary": {
    "sort": "title",
    "searchmode": "raw"
    }
    }
    }
    }
    }
    EOF
    ```
    You can now run a local test:
    ```
    datasette serve index.db --config sql_time_limit_ms:10000 --config allow_download:off --config max_returned_rows:2000 --config num_sql_threads:10 --metadata met
    adata.json
    ````
    Open your browser to http://localhost:8001/ and check the result.
    3. Now you're ready to publish :)
    Install [heroku-cli](https://devcenter.heroku.com/articles/heroku-cli) then :
    ```
    heroku login
    datasette publish heroku index.db -n calishot-3 --install=datasette-json-html --install=datasette-pretty-json --extra-options="--config sql_time_limit_ms:10000 -
    -config allow_download:off --config num_sql_threads:10 --config max_returned_rows:500" --metadata metadata.json
    ```
    ## Tadaaaaaa !