Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Move database settings changes into deprecated rather than backwards-…

…incompatible.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a81feaee4f27b7550899b233b1f818ce0fe0ed95 1 parent 4b0e080
James Bennett authored January 06, 2010

Showing 1 changed file with 62 additions and 62 deletions. Show diff stats Hide diff stats

  1. 124  docs/releases/1.2-alpha-1.txt
124  docs/releases/1.2-alpha-1.txt
@@ -80,68 +80,6 @@ changes:
80 80
 
81 81
        __members__ = property(lambda self: self.__dir__())
82 82
 
83  
-Specifying databases
84  
---------------------
85  
-
86  
-Prior to Django 1.1, Django used a number of settings to control access to a
87  
-single database. Django 1.2 introduces support for multiple databases, and as
88  
-a result, the way you define database settings has changed.
89  
-
90  
-**Any existing Django settings file will continue to work as expected
91  
-until Django 1.4.** Old-style database settings will be automatically
92  
-translated to the new-style format.
93  
-
94  
-In the old-style (pre 1.2) format, there were a number of
95  
-``DATABASE_`` settings at the top level of your settings file. For
96  
-example::
97  
-
98  
-    DATABASE_NAME = 'test_db'
99  
-    DATABASE_BACKEND = 'postgresl_psycopg2'
100  
-    DATABASE_USER = 'myusername'
101  
-    DATABASE_PASSWORD = 's3krit'
102  
-
103  
-These settings are now contained inside a dictionary named
104  
-:setting:`DATABASES`. Each item in the dictionary corresponds to a
105  
-single database connection, with the name ``'default'`` describing the
106  
-default database connection. The setting names have also been
107  
-shortened to reflect the fact that they are stored in a dictionary.
108  
-The sample settings given previously would now be stored using::
109  
-
110  
-    DATABASES = {
111  
-        'default': {
112  
-            'NAME': 'test_db',
113  
-            'BACKEND': 'django.db.backends.postgresl_psycopg2',
114  
-            'USER': 'myusername',
115  
-            'PASSWORD': 's3krit',
116  
-        }
117  
-    }
118  
-
119  
-This affects the following settings:
120  
-
121  
-    =========================================  ==========================
122  
-     Old setting                                New Setting
123  
-    =========================================  ==========================
124  
-    :setting:`DATABASE_ENGINE`                 :setting:`ENGINE`
125  
-    :setting:`DATABASE_HOST`                   :setting:`HOST`
126  
-    :setting:`DATABASE_NAME`                   :setting:`NAME`
127  
-    :setting:`DATABASE_OPTIONS`                :setting:`OPTIONS`
128  
-    :setting:`DATABASE_PASSWORD`               :setting:`PASSWORD`
129  
-    :setting:`DATABASE_PORT`                   :setting:`PORT`
130  
-    :setting:`DATABASE_USER`                   :setting:`USER`
131  
-    :setting:`TEST_DATABASE_CHARSET`           :setting:`TEST_CHARSET`
132  
-    :setting:`TEST_DATABASE_COLLATION`         :setting:`TEST_COLLATION`
133  
-    :setting:`TEST_DATABASE_NAME`              :setting:`TEST_NAME`
134  
-    =========================================  ==========================
135  
-
136  
-These changes are also required if you have manually created a database
137  
-connection using ``DatabaseWrapper()`` from your database backend of choice.
138  
-
139  
-In addition to the change in structure, Django 1.2 removes the special
140  
-handling for the built-in database backends. All database backends
141  
-must now be specified by a fully qualified module name (i.e.,
142  
-``django.db.backends.postgresql_psycopg2``, rather than just
143  
-``postgresql_psycopg2``).
144  
-
145 83
 ``__dict__`` on Model instances
146 84
 -------------------------------
147 85
 
@@ -300,6 +238,68 @@ additional arguments, those arguments can be passed to the
300 238
 
301 239
     connection = get_connection('django.core.mail.backends.smtp.EmailBackend', hostname='localhost', port=1234)
302 240
 
  241
+Specifying databases
  242
+--------------------
  243
+
  244
+Prior to Django 1.1, Django used a number of settings to control access to a
  245
+single database. Django 1.2 introduces support for multiple databases, and as
  246
+a result, the way you define database settings has changed.
  247
+
  248
+**Any existing Django settings file will continue to work as expected
  249
+until Django 1.4.** Old-style database settings will be automatically
  250
+translated to the new-style format.
  251
+
  252
+In the old-style (pre 1.2) format, there were a number of
  253
+``DATABASE_`` settings at the top level of your settings file. For
  254
+example::
  255
+
  256
+    DATABASE_NAME = 'test_db'
  257
+    DATABASE_BACKEND = 'postgresl_psycopg2'
  258
+    DATABASE_USER = 'myusername'
  259
+    DATABASE_PASSWORD = 's3krit'
  260
+
  261
+These settings are now contained inside a dictionary named
  262
+:setting:`DATABASES`. Each item in the dictionary corresponds to a
  263
+single database connection, with the name ``'default'`` describing the
  264
+default database connection. The setting names have also been
  265
+shortened to reflect the fact that they are stored in a dictionary.
  266
+The sample settings given previously would now be stored using::
  267
+
  268
+    DATABASES = {
  269
+        'default': {
  270
+            'NAME': 'test_db',
  271
+            'BACKEND': 'django.db.backends.postgresl_psycopg2',
  272
+            'USER': 'myusername',
  273
+            'PASSWORD': 's3krit',
  274
+        }
  275
+    }
  276
+
  277
+This affects the following settings:
  278
+
  279
+    =========================================  ==========================
  280
+     Old setting                                New Setting
  281
+    =========================================  ==========================
  282
+    :setting:`DATABASE_ENGINE`                 :setting:`ENGINE`
  283
+    :setting:`DATABASE_HOST`                   :setting:`HOST`
  284
+    :setting:`DATABASE_NAME`                   :setting:`NAME`
  285
+    :setting:`DATABASE_OPTIONS`                :setting:`OPTIONS`
  286
+    :setting:`DATABASE_PASSWORD`               :setting:`PASSWORD`
  287
+    :setting:`DATABASE_PORT`                   :setting:`PORT`
  288
+    :setting:`DATABASE_USER`                   :setting:`USER`
  289
+    :setting:`TEST_DATABASE_CHARSET`           :setting:`TEST_CHARSET`
  290
+    :setting:`TEST_DATABASE_COLLATION`         :setting:`TEST_COLLATION`
  291
+    :setting:`TEST_DATABASE_NAME`              :setting:`TEST_NAME`
  292
+    =========================================  ==========================
  293
+
  294
+These changes are also required if you have manually created a database
  295
+connection using ``DatabaseWrapper()`` from your database backend of choice.
  296
+
  297
+In addition to the change in structure, Django 1.2 removes the special
  298
+handling for the built-in database backends. All database backends
  299
+must now be specified by a fully qualified module name (i.e.,
  300
+``django.db.backends.postgresql_psycopg2``, rather than just
  301
+``postgresql_psycopg2``).
  302
+
303 303
 User Messages API
304 304
 -----------------
305 305
 

0 notes on commit a81feae

Please sign in to comment.
Something went wrong with that request. Please try again.