Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use schemas in Django?

I whould like to use postgreSQL schemas with django, how can I do this?

like image 308
vncprado Avatar asked Jul 21 '09 17:07

vncprado


People also ask

What are schemas in Django?

A machine-readable [schema] describes what resources are available via the API, what their URLs are, how they are represented and what operations they support.

What is schema in REST API?

Overview. A schema is metadata that tells us how our data is structured. Most databases implement some form of schema which enables us to reason about our data in a more structured manner. The WordPress REST API utilizes JSON Schema to handle the structuring of its data.

Which of the file in Django contain database schema?

Django's inspectdb feature uses the information_schema database, which contains detailed data on all database schemas.


1 Answers

Maybe this will help.

DATABASES = {     'default': {         'ENGINE': 'django.db.backends.postgresql_psycopg2',         'OPTIONS': {             'options': '-c search_path=your_schema'         },         'NAME': 'your_name',         'USER': 'your_user',         'PASSWORD': 'your_password',         'HOST': '127.0.0.1',         'PORT': '5432',     } } 

I get the answer from the following link: http://blog.amvtek.com/posts/2014/Jun/13/accessing-multiple-postgres-schemas-from-django/

like image 70
Ben Avatar answered Sep 28 '22 04:09

Ben