diff options
| author | Aymeric Augustin | 2013-11-17 22:06:41 +0100 |
|---|---|---|
| committer | Aymeric Augustin | 2013-11-17 22:07:20 +0100 |
| commit | 8c24ac93c6adfb246b8c3286ba5e5590cb0929f6 (patch) | |
| tree | 6181502247712252abedb68849f15a6f5fb6c7a9 /example | |
| parent | 8a9348a60fb2fe839be4a152ce3e70938ede2c05 (diff) | |
| download | django-debug-toolbar-8c24ac93c6adfb246b8c3286ba5e5590cb0929f6.tar.bz2 | |
Include configurations for PostgreSQL and MySQL.
Diffstat (limited to 'example')
| -rw-r--r-- | example/settings.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/example/settings.py b/example/settings.py index 0934c0e..a4e9e67 100644 --- a/example/settings.py +++ b/example/settings.py @@ -49,6 +49,30 @@ DATABASES = { } } +# To use another database, set the DJANGO_DATABASE_ENGINE environment variable. +if os.environ.get('DJANGO_DATABASE_ENGINE', '').lower() == 'postgresql': + # % su postgres + # % createuser debug_toolbar + # % createdb debug_toolbar -O debug_toolbar + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'debug_toolbar', + 'USER': 'debug_toolbar', + } + } +if os.environ.get('DJANGO_DATABASE_ENGINE', '').lower() == 'mysql': + # % mysql + # mysql> CREATE DATABASE debug_toolbar; + # mysql> GRANT ALL PRIVILEGES ON debug_toolbar.* TO 'debug_toolbar'@'localhost'; + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'debug_toolbar', + 'USER': 'debug_toolbar', + } + } + # django-debug-toolbar |
