Gramex 1.38 Release Notes

EmailAuth

EmailAuth allows any user with a valid email ID to log in. This is a convenient alternative to DBAuth. Users do not need to sign-up. Administrators don’t need to provision accounts. Gramex can restrict access based on just their email ID or domain.

For example, to allow all users from @ibm.com or @pwc.com, use:

url:
  login:
    pattern: /$YAMLURL/login
    handler: EmailAuth
    kwargs:
      service: email-service
      subject: 'OTP for <app name>'
      body: 'The OTP for {user} is {password}. Visit {link}'
  dashboard:
    ...
    kwargs:
      auth:
        membership:
          - {hd: [ibm.com, pwc.com]}
          - {email: [admin@example.org]}

FormHandler Group By

FormHandler supports grouping by columns and custom aggregations. For example: ?_by=Continent&_c=Name|count&_c=c1|min&_c=c1|avg&_c=c1|max does:

This should eliminate the need to write custom queries for most simple scenarios.

UploadHandler

UploadHandler now allows developer to specify store types. You define the store type: to store uploaded files metadata. Earlier, only HDF5 store is allowed. But this has stability issues. From 1.38 onwards type:sqlite is defaulted. Older apps with .meta.h5 will be migrated to .meta.db, incase the migration fails, gramex will raise an exception and stop.

Apache Load Balancing

Apart from documenting how to setup minimal nginx reverse proxy for Gramex apps, Gramex guide also documents how to setup Apache Load Balancing.

Developer Updates

g1

Quickstart

quickstart tutorial is now updated with FDD: Formhandler Driven Dashboard approach, through a more generalized version of creating a dashboard/app in Gramex.

Bug fixes

Stats

Upgrade

To upgrade Gramex, run:

pip install --verbose gramex==1.38

This downloads Chromium and other front-end dependencies. That may take time.