Django, getting data from another user (schema) in an Oracle 19 DB

I am using Django 4.1, Oracle 19 with the python package oracledb. I am logged in as user djangousr and the schema I am trying to get the data from is "user123" I am able to retrieve data in a file outside of Django with the same connection information. But in Django, I keep getting the same error.

I hope you have a solution for me as I was not able to find anything elsewhere. Thank you.

ORA-00942: table or view does not exist

Below is the SQL from the debug screen that I am able to run fine in SQL developer.

('SELECT "USER"."USER_ID" FROM "user123.USER_TABLE"')

I will also provide the model and the view:

class SecurityUserData(models.Model): 

    user_id = models.IntegerField(primary_key=True) 
    user_name = models.CharField(max_length=100) 
    user_password = models.CharField(max_length=100) 
    user_first_name = models.CharField(max_length=30, blank=True, null=True) 
    user_last_name = models.CharField(max_length=30, blank=True, null=True)     

    class Meta: 
        managed = False 
        db_table = 'SEC_USER' 

And the view:

def display_user_data(request): 
    user_data = SecurityUserData.user123.all() 
    return render(request, 'all.html', {'user_data': user_data}) 
Back to Top