Skip to content

Instantly share code, notes, and snippets.

def authenticate(self,hostname, client_id, client_secret, username, password):
uri_path = '/oauth/token'
headers = {'Content-Type':'application/x-www-form-urlencoded'}
params = {'grant_type':'password', 'client_id':client_id, 'client_secret':client_secret,
'username':username, 'password':password}
http = httplib.HTTPSConnection(hostname)
http.request('POST', uri_path, urllib.parse.urlencode(params), headers=headers)
response = http.getresponse()
[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = False
db_port = False
db_user = <db_user>
db_password = <db_password>
addons_path = /opt/odoo10/addons,/opt/<your_project_folder>
#!/usr/bin/env python2
import os
import sys
import StringIO
import psycopg2
import psycopg2.extensions
from optparse import OptionParser
from ConfigParser import SafeConfigParser
try: