django.db.utils.DatabaseError: ORA-12154: TNS:could not resolve the connect identifier specified
<p>Trying to connect to the Oracle DB via settings.py</p>

<pre><code>DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.oracle', 
        'NAME': 'Hostname:Port/Service name not SID',  
        'USER': 'Username',                      
        'PASSWORD': 'Password',                                     
    }
}
</code></pre>

<p>Based on what I have found online, that is supposed to be how I connect to an Oracle DB via service name if I do not have SID. But I still get the error <code>django.db.utils.DatabaseError: ORA-12154: TNS:could not resolve the connect identifier specified</code></p>

<p>If I however forgo placing these details in the <code>settings.py</code> and I just use the connection strings provided by <code>cx_Oracle</code>,</p>

<pre><code>dsn_tns = cx_Oracle.makedsn('Hostname', 'Port', 
                             service_name='Service name not SID')
connection = cx_Oracle.connect('Username', 'Password', dsn_tns)
</code></pre>

<p>I connect just fine. Is there a new syntax to connect to the service name for settings.py? Is there a point in trying to connect via settings.py if I can simply connect via the connection strings?</p>