I'm trying to develop a django interface for an existing postgresql db, the
db makes use of various schemas, looking at the literature the following
example should work, but it only returns the schema defined in the default
database when I run python manage.py inspectdb. Also when this works, how
do I define which schema to use when defining the django model?
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'OPTIONS' : {
'options': '-c search_path=public'
},
'NAME': 'gygaia',
'USER':'postgres',
'PASSWORD':'abc',
'HOST':'localhost',
'PORT':'5432',},
'samples': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'OPTIONS' : {
'options': '-c search_path=samples'
},
'NAME': 'gygaia',
'USER':'postgres',
'PASSWORD':'abc',
'HOST':'localhost',
'PORT':'5432',},
'excavation': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'OPTIONS' : {
'options': '-c search_path=excavation'
},
'NAME': 'gygaia',
'USER':'postgres',
'PASSWORD':'abc',
'HOST':'localhost',
'PORT':'5432',
},}
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/b9cfca9e-11c9-40e8-8e8c-1436cc2fdc1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.