Tips & Tricks

Reuse code

Duplicated Python code is a common problem. Here are suggestions to reduce that.

  1. Use loops to avoid duplication
  2. Group common code into functions
  3. Look up values to handle variations
  4. Store data in data files, not Python files

Gramex Tips

  1. Reuse YAML Configurations
  2. Cache and Open files in Gramex
  3. Automatically fixing Python build errors
  4. Function reloading
  5. Using YAMLURL and YAMLPATH
  6. Finding slow code
  7. Websockets
  8. Send email via command line
  9. Testing build errors locally
  10. Schedule tasks at periodic internal
  11. File upload and processing
  12. FormHandler: filtering data
  13. Filter data using url
  14. File download
  15. Guide to anonymising confidential data
  16. Serve multiple files using single URL
  17. Automated email alerts in Gramex
  18. Logins for apps on UAT
  19. Cache calculations in Gramex
  20. Customized errors in Gramex
  21. Debugging CaptureHandler for screenshots
  22. FormHandler: views instead of query
  23. Conditions in Gramex
  24. Windows IntegratedAuth - Kerberos authentication
  25. FormHandler: enhancements
  26. Conditional configurations in Gramex
  27. YAML supports multi-line strings
  28. Securing Gramex deployments
  29. FormHandler: Database or File edits
  30. Gramex Configurations
  31. Initialize Gramex Projects
  32. Gramex console shows handler name