LoginSignup
1
0

More than 5 years have passed since last update.

Djangoのデータベース設定でschemaを指定する方法

Posted at

Django:1.10

settings.pyのDATABASESのOPTIONSにスキーマ名を指定する。

settings.py
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'testdb',
        'USER': 'testuser',
        'PASSWORD': 'testpassword',
        'HOST': 'localhost',
        'PORT': '5432',
        'OPTIONS': {
            'options': '-c search_path=schema_name'
        },
    }
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0