File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,16 @@ the libraries required for working on the Debug Toolbar::
24
24
25
25
You can run now run the example application::
26
26
27
+ $ DJANGO_SETTINGS_MODULE=example.settings django-admin.py syncdb
28
+ $ DJANGO_SETTINGS_MODULE=example.settings django-admin.py runserver
29
+
30
+ For convenience, there's an alias for the second command::
31
+
27
32
$ make example
28
33
34
+ Look at ``example/settings.py `` for running the example with another database
35
+ than SQLite.
36
+
29
37
Tests
30
38
-----
31
39
Original file line number Diff line number Diff line change 49
49
}
50
50
}
51
51
52
+ # To use another database, set the DJANGO_DATABASE_ENGINE environment variable.
53
+ if os .environ .get ('DJANGO_DATABASE_ENGINE' , '' ).lower () == 'postgresql' :
54
+ # % su postgres
55
+ # % createuser debug_toolbar
56
+ # % createdb debug_toolbar -O debug_toolbar
57
+ DATABASES = {
58
+ 'default' : {
59
+ 'ENGINE' : 'django.db.backends.postgresql_psycopg2' ,
60
+ 'NAME' : 'debug_toolbar' ,
61
+ 'USER' : 'debug_toolbar' ,
62
+ }
63
+ }
64
+ if os .environ .get ('DJANGO_DATABASE_ENGINE' , '' ).lower () == 'mysql' :
65
+ # % mysql
66
+ # mysql> CREATE DATABASE debug_toolbar;
67
+ # mysql> GRANT ALL PRIVILEGES ON debug_toolbar.* TO 'debug_toolbar'@'localhost';
68
+ DATABASES = {
69
+ 'default' : {
70
+ 'ENGINE' : 'django.db.backends.mysql' ,
71
+ 'NAME' : 'debug_toolbar' ,
72
+ 'USER' : 'debug_toolbar' ,
73
+ }
74
+ }
75
+
52
76
53
77
# django-debug-toolbar
54
78
You can’t perform that action at this time.
0 commit comments