How to use schemas in Django?


Question

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

1
27
7/21/2009 5:30:53 PM

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/

28
2/11/2015 10:35:48 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon