Search code examples
profilingweb2pypythonanywhere

Enabling the web2py profiler on pythonanywhere


There is a (seemingly) simple way to generate profiler information about a web2py installation, by just adding a -F flag. How, if it is possible, would this be enabled on a web2py site hosted on http://pythonanywhere.com?


Solution

  • In the WSGI file for your web app, you currently have a line:

    from gluon.main import wsgibase as application
    

    replace it with:

    from gluon.main import appfactory
    application = appfactory(profiler_dir="/tmp")
    

    and your web2py app will log profiling data to the /tmp directory.