aboutsummaryrefslogtreecommitdiffstats
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/settings.py24
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