web2py on an existing PostgreSQL Database?

39 views
Skip to first unread message

Ulrich Goebel

unread,
Nov 28, 2019, 4:07:55 PM11/28/19
to web2py-users
Hi,

I have an existing PostgreSQL Database with about 20 tables, using collating sequences, foreign keys, triggers, and even additional indexes. For that database I want to write a WEB-frontend to insert, update and delete data in the database. I don't want to define the data model in python or web2py, but want to make django/python work on the existing database.

Is that possible? Where to find som helpful hints how to do that?

Best regards
Ulrich

Massimo Di Pierro

unread,
Nov 28, 2019, 6:17:17 PM11/28/19
to web2py-users
Cannot talk about Django.

In web2py you can run the script: web2py/scripts/extract_pgsql_models.py which will generate a model from your database table. It is not guaranteed to work. It depends on the type of references that you have. Also after it crates the model for you, you may need to modify it since in order to generate forms, web2py may need more info that it can extract from the database. In any case, after the model is generated the appadmin should work.

You probably are better off using this https://www.pgadmin.org/
Reply all
Reply to author
Forward
0 new messages