Getting a demo_mode not defined error in admin (even though demo_mode defined in 0.py)

17 views
Skip to first unread message

Mark Li

unread,
Jul 29, 2015, 3:06:46 PM7/29/15
to web2py-users
I am getting a very odd error in my admin app (2.9.10) on PythonAnywhere. I am getting the following error:

Traceback (most recent call last):
  File "/home/marladarla7/web2py/gluon/restricted.py", line 224, in restricted
    exec ccode in environment
  File "applications/admin/models/0_imports.py", line 15, in <module>
    from mercurial import ui, hg, cmdutil
  File "/home/marladarla7/web2py/gluon/custom_import.py", line 71, in custom_importer
    return NATIVE_IMPORTER(oname, globals, locals, fromlist, level)
  File "mercurial.py", line 3, in <module>
    if DEMO_MODE or MULTI_USER_MODE:
NameError: name 'DEMO_MODE' is not defined

I have checked 0.py model, and DEMO_MODE = False, so I have no idea why I am getting this error

This error started occurring after I unzipped the 2.9.10 web2py zip over my old install (2.7.4).

Mark Li

unread,
Jul 30, 2015, 12:53:26 AM7/30/15
to web2py-users, markru...@gmail.com
 I upgraded to version 2.11.2, but the error was still occurring. I deleted all the .pyc files from the web2py directory and this seems to have solved the problem.
Reply all
Reply to author
Forward
0 new messages