How do I specify database in odoo Controller rather than select it manually from the browser?
My code
@http.route('/test/', type='http', auth='public', website=True, db='test')
def index(self, **kw):
return "Salutation"
this is what I did and then if I went to localhost:8069/test/ I got 404 Not found error. but if I go to localhost:8069/database/selector and select the database I get the right response. How do I specify the database in odoo Controller rather than select it manually from the browser
On your server, in src/odoo, you should create a new file: my_odoo_configuration.conf, where you can store the information about the main database you are using:
And you can switch the database when launching odoo from the command line:
More configuration details can be found on the official documentation: https://www.odoo.com/documentation/16.0/developer/reference/cli.html#database