Until I make this change I can click on the Database Administration link for this app and go to the listing of database files for this application.
Once I make this change and click the Database Administration link, I get :the ticket with the error listing below. Now I have tied both copying the new db.py content and typing it in, multiple times. The manual does not say to do anything but replace the text, save, and then click the images application data base administration link. It always errors with:
Traceback (most recent call last): File "C:\web2py_win\web2py\gluon\restricted.py", line 219, in restricted exec(ccode, environment) File "C:/web2py_win/web2py/applications/images/models/menu.py", line 16, in <module> if not configuration.get('app.production'): NameError: name 'configuration' is not defined
Error snapshot
<type 'exceptions.NameError'>(name 'configuration' is not defined)
File C:\web2py_win\web2py\gluon\restricted.py in restricted at line 219codeargumentsvariables
File C:\web2py_win\web2py\applications\images\models\menu.py in <module> at line 16codeargumentsvariables
Function argument list
()
Code listing
11. 12. 13. 14. 15.
16.
17. 18. 19. 20.
# ---------------------------------------------------------------------------------------------------------------------- # provide shortcuts for development. you can remove everything below in production # ----------------------------------------------------------------------------------------------------------------------
In file: C:\web2py_win\web2py\applications\images\models\menu.py
1.
<code object <module> at 03B9D890, file "C:\web2py_win\web2py\applications\images\models\menu.py", line 9>
Anthony
unread,
Feb 14, 2018, 10:47:57 AM2/14/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Good catch. The problem is the new default version of db.py creates a "configuration" object, which is subsequently referenced in the menu.py model file.
Anyway, there is no need to completely replace the contents of db.py -- just add the content shown, except you don't need the db = DAL(...) line.
Anthony
Bryan Nahrwold
unread,
Feb 14, 2018, 3:00:14 PM2/14/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Thanks, Anthony. That works.
Bryan Nahrwold
unread,
Feb 14, 2018, 3:04:54 PM2/14/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
However, it does not work unless I include the linne you said to omit:
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
On Wednesday, February 14, 2018 at 3:04:54 PM UTC-5, Bryan Nahrwold wrote:
However, it does not work unless I include the linne you said to omit:
db = DAL("sqlite://storage.sqlite")
If you are starting with the scaffolding app, it should already include:
configuration =AppConfig(reload=True)
ifnot request.env.web2py_runtime_gae: # --------------------------------------------------------------------- # if NOT running on Google App Engine use SQLite or other DB # --------------------------------------------------------------------- db = DAL(configuration.get('db.uri'), pool_size=configuration.get('db.pool_size'), migrate_enabled=configuration.get('db.migrate'), check_reserved=['all'])
So, you should not need to redefine the db object. Do you not have the above code in your db.py, or was it generating an error?