diff options
| -rw-r--r-- | docs/contributing.rst | 8 | ||||
| -rw-r--r-- | example/settings.py | 24 | 
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 | 
