I decided to move from 'pymysql' to 'bottle-pymysql' plugin. i have this code:
I don'understand it, because before using bottle_pymysql i uses pymysql adn that line was interpreted correctly. Now with bottle_pymysql it does not. What can i do?
Thank you.
and also this error:
# dbhost is optional, default is localhost plugin = bottle_pymysql.Plugin( dbuser='nikos', dbpass='*******', dbname='counters', charset = 'utf8' ) app.install(plugin) ..... ..... for visit in visits: visit = visit.strftime('%A %e %b, %I:%M %p')When trying to read that view, bottle() gives me this error:
Output:Traceback:
Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/bottle.py", line 862, in _handle
return route.call(**args)
File "/usr/lib64/python3.6/site-packages/bottle.py", line 1740, in wrapper
rv = callback(*a, **ka)
File "/usr/lib/python3.6/site-packages/bottle_pymysql.py", line 174, in wrapper
rv = callback(*args, **kwargs)
File "/home/nikos/wsgi/www.py", line 132, in log
visit = visit.strftime('%A %e %b, %I:%M %p')
AttributeError: 'str' object has no attribute 'strftime'
What does this error mean? I don'understand it, because before using bottle_pymysql i uses pymysql adn that line was interpreted correctly. Now with bottle_pymysql it does not. What can i do?
Thank you.
and also this error:
@app.route( '/' ) @auth_basic(is_authenticated_user) def index( pymydb ): pdata = '' names = [] pymydb.execute( '''SELECT name, phone, hits, money FROM clients ORDER BY hits DESC''' ) data = pymydb.fetchall()
Output:TypeError("index() missing 1 required positional argument: 'pymydb'",)
Traceback:
Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/bottle.py", line 862, in _handle
return route.call(**args)
File "/usr/lib64/python3.6/site-packages/bottle.py", line 1740, in wrapper
rv = callback(*a, **ka)
File "/usr/lib64/python3.6/site-packages/bottle.py", line 2690, in wrapper
return func(*a, **ka)
TypeError: index() missing 1 required positional argument: 'pymydb'