Tips & Tricks
Reuse code
Duplicated Python code is a common problem. Here are suggestions to reduce that.
- Use loops to avoid duplication
- Group common code into functions
- Look up values to handle variations
- Store data in data files, not Python files
Gramex Tips
Below is the list of tips for Gramex use that have been shared via email as well
- 2017/06/29 - YAML Reuse Configurations
- 2017/07/05 - Cache and Open files in Gramex
- 2017/07/06 - Automatically fixing Python build errors
- 2017/07/10 - Function reloading
- 2017/07/11 - Using YAMLURL and YAMLPATH
- 2017/07/20 - Finding slow code
- 2017/07/21 - Websockets
- 2017/07/28 - Send email via command line
- 2017/08/08 - Testing build errors locally
- 2017/08/09 - Schedule tasks at periodic internal
- 2017/08/28 - File upload and processing
- 2017/08/31 - FormHandler: filtering data
- 2017/09/01 - Gramex offline install
- 2017/09/05 - Filter data using url
- 2017/09/06 - File download
- 2017/09/07 - Guide to anonymising confidential data
- 2017/09/11 - Serve multiple files using single URL
- 2017/09/18 - Automated email alerts in Gramex
- 2017/09/18 - Logins for apps on UAT
- 2017/09/19 - Cache calculations in Gramex
- 2017/09/20 - Customized errors in Gramex
- 2017/09/20 - Debugging CaptureHandler for screenshots
- 2017/09/21 - FormHandler: views instead of query
- 2017/10/09 - Conditions in Gramex
- 2017/10/09 - Windows IntegratedAuth - Kerberos authentication
- 2017/10/10 - FormHandler: enhancements
- 2017/10/17 - Conditional configurations in Gramex
- 2017/10/19 - YAML supports multi-line strings
- 2017/10/20 - Securing Gramex deployments
- 2017/10/25 - FormHandler: Database or File edits
- 2017/11/05 - Gramex Configurations
- 2017/11/07 - Initialize Gramex Projects
- 2017/12/21 - Gramex console shows handler name