From 8c24ac93c6adfb246b8c3286ba5e5590cb0929f6 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 17 Nov 2013 22:06:41 +0100 Subject: Include configurations for PostgreSQL and MySQL. --- example/settings.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'example') 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 -- cgit v1.2.3