0

I am going to develop django rest framework apis using postgres legacy database in which apart from the existing tables no other default django tables should be created. I would like to know without creating any django default tables or doing migrations,

  1. can i able to access records from tables using ORM?
  2. Can i able to access admin page without creating django auth table (i.e superuser)?
  3. If no for both questions, only way to connect to db is using any db adapter like psycopg2?
User123
  • 793
  • 4
  • 10
  • 28

1 Answers1

0

can i able to access records from tables using ORM?

If the schema is same in your models and DB tables, then yes.

Can i able to access admin page without creating django auth table (i.e superuser)?

As far as I can tell, no, you can't get that, unless your existing 'tables' already have that, and you have all the necessary credentials.

For question in #3, I'd use something less constraining like Flask if you have these problems.

0xc0de
  • 8,028
  • 5
  • 49
  • 75
  • Thanks @0xc0de for the detailed response. Eventhough, schema name is same,when querying django will look for table something like modelname_tablename right? So obviously, there wont be any table in existing db. – User123 Dec 25 '20 at 06:28