Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8256359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:50:34+00:00 2026-06-08T01:50:34+00:00

In the following code, if I hit /testDbOne I get no errors, if I

  • 0

In the following code, if I hit /testDbOne I get no errors, if I hit /testDbTWo I get the following error:

TypeError('testDbTwo() takes exactly 1 argument (0 given)',)

If I swap the position of engine1 and engine2, then testDbOne breaks and testDbTwo works. What am I doing wrong that I can’t have SQLAlchemy create both sessions and install them into bottle as plugins?

Base = declarative_base()

#engine1
engine_s = create_engine('mysql://user:pass@localhost/dbone', echo=True)
create_session_s = sessionmaker(bind=engine_s)
bottle.install(SQLAlchemyPlugin(engine_s, Base.metadata, keyword="dbone"))

#engine2
engine = create_engine('mysql://user:pass@localhost/dbtwo', echo=True)
create_session = sessionmaker(bind=engine)
bottle.install(SQLAlchemyPlugin(engine, Base.metadata, keyword="dbtwo"))

#create the actual database sessions
dboneSession = create_session_s()
dbTwoSession = create_session()

@route("/testDbOne")
def testUserOne(dbone):
    return "no error here"

@route("/testDbTwo")
def testDbTwo(dbtwo):
    return "no error here"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:50:36+00:00Added an answer on June 8, 2026 at 1:50 am

    If you add sqlalchemy information to your route, then it starts to work ok. For example:

    @route("/testDbOne", sqlalchemy=dict(keyword='dbone'))
    def testUserOne(dbone):
        return "no error here"
    
    @route("/testDbTwo", sqlalchemy=dict(keyword='dbtwo'))
    def testDbTwo(dbtwo):
        return "no error here"
    

    Seems to work for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following code takes like 2500 milliseconds on an i7-*3.4 GHz windows-7 64-bit computer to
I have the following code, and it works fine until i hit the the
I have the following code: RewriteEngine on RewriteRule ^example/? test.php When I hit www.example.com/example
Can I get some help with the following code? $(document).ready(function() { $('#searchform').submit(function() { var
I Have the following code which fires OnCreatedUser and doesn't throw any errors. Profile.Title
Using the following code, every time I hit the submit button the values all
Given the following code Public Shared Sub DoAsyncAction() Using asmxProxy As New MyAsmxServiceProxy() AddHandler
In clisp, the following code works: (defun hit-history () (shell tail ssqHitNum.txt)) However, in
The following code is used to validate when form submit button is hit, but
I have the following code that is working but when I hit the hardware

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.