Search code examples
djangopostgresqldjango-admindjango-postgresql

Create Django admin panel where project is created using another language


I have created a project using Golang. I have used PostgreSQL as the database. Now I want to make an admin panel for this project using Django. I want directly reflect the database tables in the Django admin panel. As I am not running the project under the Django server and I don't have any apps and models, how can I show them in the admin panel?


Solution

  • What you want is to use an existing DB to be managed by the DJango admin. To do this you must create a django project and create the models for each table. This is very tedious so there is an official process so you don't have to do all this work and it is done automatically.

    $ python manage.py inspectdb
    

    https://docs.djangoproject.com/en/4.1/howto/legacy-databases/