aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAymeric Augustin2013-11-17 22:06:41 +0100
committerAymeric Augustin2013-11-17 22:07:20 +0100
commit8c24ac93c6adfb246b8c3286ba5e5590cb0929f6 (patch)
tree6181502247712252abedb68849f15a6f5fb6c7a9
parent8a9348a60fb2fe839be4a152ce3e70938ede2c05 (diff)
downloaddjango-debug-toolbar-8c24ac93c6adfb246b8c3286ba5e5590cb0929f6.tar.bz2
Include configurations for PostgreSQL and MySQL.
-rw-r--r--docs/contributing.rst8
-rw-r--r--example/settings.py24
2 files changed, 32 insertions, 0 deletions
diff --git a/docs/contributing.rst b/docs/contributing.rst
index e27e6b7..8a45b1a 100644
--- a/docs/contributing.rst
+++ b/docs/contributing.rst
@@ -24,8 +24,16 @@ the libraries required for working on the Debug Toolbar::
You can run now run the example application::
+ $ DJANGO_SETTINGS_MODULE=example.settings django-admin.py syncdb
+ $ DJANGO_SETTINGS_MODULE=example.settings django-admin.py runserver
+
+For convenience, there's an alias for the second command::
+
$ make example
+Look at ``example/settings.py`` for running the example with another database
+than SQLite.
+
Tests
-----
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