You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from bottle import Bottle,install, template,TEMPLATE_PATH
from bottle_sqlite import SQLitePlugin
app = Bottle()
sqlite_plugin = SQLitePlugin(dbfile='my.db')
app.install(sqlite_plugin)
@app.route('/show1/<post_id:int>')
def show(db, post_id):
c = db.execute('SELECT title, content FROM posts WHERE id = ?', (post_id,))
row = c.fetchone()
return template('show_post', title=row['title'], text=row['content'])
@app.route('/show2/<post_id:int>',skip=[sqlite_plugin])
def show(db, post_id):
c = db.execute('SELECT title, content FROM posts WHERE id = ?', (post_id,))
row = c.fetchone()
return template('show_post', title=">>>> "+row['title'], text=row['content'])
@app.route('/hello')
def hello():
return "<h1 style='color:blue'>Hello There!</h1>"
if __name__ == "__main__":
app.run(host='0.0.0.0',port=8001)
Error:
Bottle v0.12.25 server starting up (using WSGIRefServer())...
Listening on http://0.0.0.0:8001/
Hit Ctrl-C to quit.
Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\bottle.py", line 876, in _handle
return route.call(**args)
^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\bottle.py", line 201, in __get__
value = obj.__dict__[self.func.__name__] = self.func(obj)
^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\bottle.py", line 504, in call
return self._make_callback()
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\bottle.py", line 540, in _make_callback
callback = plugin.apply(callback, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\bottle_sqlite.py", line 114, in apply
argspec = inspect.getargspec(_callback)
^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'
192.168.3.19 - - [28/Jul/2023 03:57:12] "GET /hello HTTP/1.1" 500 749
The text was updated successfully, but these errors were encountered:
As you can see from the traceback, this is an issue in the bottle_sqlite plugin and should be reported there. Nevertheless, the repository over there already has three unmerged PRs covering this topic, with the oldest one being from 2018: bottlepy/bottle-sqlite#23
OS= win10
Python = 3.11.4
bottle = 0.12.25
bottle-sqlite = 0.2.0
it's my code:
Error:
The text was updated successfully, but these errors were encountered: