So I found Help installing cx_Oracle but am still stuck. I downloaded the latest instantclient from oracle, and set ORACLE_HOME to the location of the extracted files (both
After struggling I found below method. I am using Windows and have separate environment for django.
run all below command one by one to test connection, mind the indentation at the last for loop.
import cx_Oracle
connection = cx_Oracle.connect("your_username", "your_psw", "localhost/orcl")
cursor = connection.cursor()
cursor.execute("""select to_char(sysdate, 'dd-mon-yyyy') from dual""")
for cdate in cursor:
print("Today the date is ", cdate)
Output:
Today the date is ('08-nov-2019',)