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 7175045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:11:50+00:00 2026-05-28T16:11:50+00:00

I have a controller written in python cherrypy that should check if a db

  • 0

I have a controller written in python cherrypy that should check if a db url is valid by attepting to make a connection. I’m having problems however passing the parameter to the method. My ajax call is:

    $.ajax({ async : false,
        type: 'POST',
        url: "/settings/check_db_url/"+db_url ,
        success: function(r) { alert(r) },
        error: function(r) { alert('failure') }
    });

Now the problem the urls that I need to test are in the form of:

'sqlite':'sqlite:///Users/Home/tvb-database.db' or
'postgresql+psycopg2://postgres:root@127.0.0.1:5432/tvb?user=postgres&password=postgres'

For the sqlite part I managed to pass it if I do something like:

    db_url = db_url.split('/').join('__')
db_url = db_url.split(':').join('x_xxx_x')

And then replace back in python. But this seems so hacky to me and for the postgress part I guess I’ll have to replace some more. So what is the correct way to handle this?

  • 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-05-28T16:11:51+00:00Added an answer on May 28, 2026 at 4:11 pm

    Send it as part of a POST parameter and not as part of the url using the data option:

    $.ajax({ 
        async : false,
        type: 'POST',
        url: '/settings/check_db_url',
        data: { db_url: db_url },
        success: function(r) { alert(r) },
        error: function(r) { alert('failure') }
    });
    

    And in your server read the db_url POST parameter.

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

Sidebar

Related Questions

I have written a controller action that checks for the existence of a PDF
I have a controller action that is being executed by a link that was
I have multiple controller actions that takes an id public ActionResult Get(int? id) {
I have a controller with that I want to pass off some data to
I have a controller that contains a tableView that spawns another controller modally to
I have written the following code : @Controller @RequestMapping(/test) public class Home { @RequestMapping(value
I have a simple blog application written in Python, using Django. I use Git
I have written an ASP.NET MVC application that runs inside an IFrame. When one
I have a tab bar controller that I have created programmatically, named TPastJourneyTabbar .
yes but i have a problem i have created a controller that inherits from

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.