# Generated by gramex init on {{ date }} by {{ author }} <{{ email }}>. Please retain this line.

# Configurations for app: {{ appname }}
# ----------------------------------------------------------------------------









# Gramex init configurations for app: {{ appname }}
# ----------------------------------------------------------------------------
import:
  # To secure application for production,
  # replace 'YOUR-PROD-SERVER-NAME' with your production server host name.
  deploy if socket.gethostname() in {'YOUR-PROD-SERVER-NAME'}: $GRAMEXPATH/deploy.yaml
  # For alternate methods, see https://learn.gramener.com/guide/config/#conditions

  # /ui/ has Gramex UI components -- use this like the node_modules/ directory
  ui:
    path: $GRAMEXAPPS/ui/gramex.yaml
    YAMLURL: $YAMLURL/ui/

  # /admin/ as an admin page to manage users, get system info, etc.
  admin:
    path: $GRAMEXAPPS/admin2/gramex.yaml    # Note the "admin2" instead of "admin"
    YAMLURL: /$YAMLURL/admin/               # URL to show the admin page at
    ADMIN_KWARGS:
      logo: https://gramener.com/uistatic/gramener.png
      title: Admin
      theme: '?primary=%2320186f&dark=%2320186f&font-family-base=roboto&body-bg=%23f8f8f8'
      # authhandler: name-of-DBAuth-handler    -- required for user management
    ADMIN_AUTH:
      membership:
        hd: gramener.com                    # Only @gramener.com Google Auth are admins


handlers:
  BaseHandler:
    # Custom error pages for this application
    error:
      400: {path: $YAMLPATH/error/400.html}     # Bad request: e.g. URL argument missing
      401: {path: $YAMLPATH/error/401.html}     # Unauthorized: User not logged in
      403: {path: $YAMLPATH/error/403.html}     # Forbidden: user does not have access
      404: {path: $YAMLPATH/error/404.html}     # File not found
      500: {path: $YAMLPATH/error/500.html}     # Internal server error
