Skip to content

syntax error near unexpected token `SQLitePlugin' #25

@TRSx80

Description

@TRSx80

Hi guys!

Thank you very much for creating and sharing this project. I'm really excited about the possibilities.

I got the basics working, however I ran into a problem trying to connect to an sqlite3 database. I suspect my problem revolves around improper scope, naming, or something like that.

By the way, I really appreciate that you guys wrote the basic tutorial leaving out stuff like app.@route, etc. and introduce that later on. Personally I find the OO stuff just confusing, and unnecessarily complex for a small project.

Anyway, when trying to implement the sqlite plugin, the examples given all revolve around OO type naming. I tried to convert it, even looked at different examples, including the source, but I still could not get it to work. I keep getting variations of the error in the title.

I first tried this way (minimal example):

# app.py
from bottle import install, request, route, run, static_file, template
from bottle_sqlite import SQLitePlugin

install(SQLitePlugin(dbfile='database.sqlite3'))

Then I try this way:

# app.py
from bottle import install, request, route, run, static_file, template
from bottle.ext import sqlite

install(sqlite.Plugin(dbfile='database.sqlite3'))

But when I launch my app.py I just keep getting variation of:

from: too many arguments
from: too many arguments
./app.py: line 4: syntax error near unexpected token `SQLitePlugin'
./app.py: line 4: `install(SQLitePlugin(dbfile='database.sqlite3'))'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions