On Monday, February 4, 2019 at 12:58:58 AM UTC-5, Yi Liu wrote:
>
> Thank you for your reply, Dave. If I understand you correctly, I already 
> did what you suggested: move those imports into a module file. It did not 
> help.
>

The problem is that you moved the imports to a module, but then you 
imported *that *module in your model file, which is equivalent to simply 
having all the imports in your model file. Note that model files are 
executed on every request (unless you are using the conditional model 
functionality), so any imports also happen on every request (including any 
imports made by your imported modules). Typically this does not slow things 
down on subsequent requests because Python keeps the imported objects in 
memory, but in this case it sounds like Plotly also executes some fairly 
slow code on import (https://github.com/plotly/plotly.py/issues/740).

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to