On Feb 20, 12:50 pm, Brandon Taylor <btaylordes...@gmail.com> wrote:
> OK, I am pretty sure I found out where to put the tns_names.ora file:
> $ORACLE_HOME/network/admin
>
> But, I'm confused as to how to specify the database name. From the
> Django Oracle docs (http://docs.djangoproject.com/en/dev/ref/
> databases/?from=olddocs#id9) they have the SID as the DATABASE_NAME
> setting.

Those docs could use some clarification.  If you specify the database
host and port, then DATABASE_NAME is indeed the SID.  If you don't
specify host and port, then DATABASE_NAME is the TNS name that will be
used to look up the connection info.

> If I set my DATABASE_NAME to my SID, and try to retrieve objects, I
> get:
>
> DatabaseError: ORA-00942: table or view does not exist

Regardless of the above, this error suggests that you are in fact
successfully connecting now, but that the tables Django is looking for
don't exist.  This could be because you haven't run Django's syncdb
command [http://docs.djangoproject.com/en/dev/ref/django-admin/
#syncdb] to create the tables; or if you're connecting to a legacy
database, because Django is looking for its automatically generated
table names and not finding them.  In the latter case, you should
specify the 'db_table' Meta option [http://docs.djangoproject.com/en/
dev/ref/models/options/#db-table] on each of your models to the actual
name of the table.

Hope this helps,
Ian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to