WHY it compains about the missing argument is WHAT i don't understand.

24 views
Skip to first unread message

Νίκος Βέργος

unread,
Oct 8, 2019, 1:09:38 PM10/8/19
to bottlepy
plugin = bottle_pymysql.Plugin( dbuser='user', dbpass='pass', dbname='counters', dictrows=False )
app.install(plugin)

.......
.......

@app.route( '/' )
@auth_basic( counters.is_authenticated_user )
def listall( pymydb ):

But when i try to load the app's URL like http://superhost.gr/clientele as you can see i get this error:

Exception:
TypeError("listall() missing 1 required positional argument: 'pymydb'",)
Traceback:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/bottle.py", line 862, in _handle
return route.call(**args)
File "/usr/lib/python3.6/site-packages/bottle.py", line 1740, in wrapper
rv = callback(*a, **ka)
File "/usr/lib/python3.6/site-packages/bottle.py", line 2690, in wrapper
return func(*a, **ka)
TypeError: listall() missing 1 required positional argument: 'pymydb'

listall() is `/` route's callback function and i never inside my script i call listall( pymydb ).
Why it compains about the missing argument is WHAT i don't understand.
Reply all
Reply to author
Forward
0 new messages