Skip to content

Commit ccdd95a

Browse files
committed
update README
1 parent 1e305ec commit ccdd95a

File tree

1 file changed

+31
-21
lines changed

1 file changed

+31
-21
lines changed

README.rst

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,22 @@ Installation
3131

3232
pip install django-pyodbc
3333

34-
2. Now you can point the ``DATABASE_ENGINE`` setting in the settings file used
35-
by your Django application or project to the ``'sql_server.pyodbc'``
36-
module path::
37-
38-
DATABASE_ENGINE='sql_server.pyodbc'
34+
2. Now you can now add a database to your settings using standard ODBC parameters.::
35+
36+
DATABASES = {
37+
'default': {
38+
'ENGINE': "django_pyodbc",
39+
'HOST': "127.0.0.1,1433",
40+
'USER': "mssql_user",
41+
'PASSWORD': "mssql_password",
42+
'NAME': "database_name",
43+
'OPTIONS': {
44+
'host_is_server': True
45+
},
46+
}
47+
}
48+
49+
3. That's all!
3950

4051
Configuration
4152
=============
@@ -45,23 +56,20 @@ The following settings control the behavior of the backend:
4556
Standard Django settings
4657
------------------------
4758

48-
``DATABASE_NAME``
59+
``NAME``
4960
String. Database name. Required.
5061

51-
``DATABASE_HOST``
52-
String. SQL Server instance in ``"server\instance"`` format.
53-
54-
``DATABASE_PORT``
55-
String. Server instance port.
62+
``HOST``
63+
String. SQL Server instance in ``server\instance`` or ``ip,port`` format.
5664

57-
``DATABASE_USER``
65+
``USER``
5866
String. Database user name. If not given then MS Integrated Security will
5967
be used.
6068

61-
``DATABASE_PASSWORD``
69+
``PASSWORD``
6270
String. Database user password.
6371

64-
``DATABASE_OPTIONS``
72+
``OPTIONS``
6573
Dictionary. Current available keys are:
6674

6775
``autocommit``
@@ -80,7 +88,7 @@ Standard Django settings
8088
Unix/Linux.
8189

8290
By default, when using the FreeTDS ODBC driver the value specified in
83-
the ``DATABASE_HOST`` setting is used in a ``SERVERNAME`` ODBC
91+
the ``HOST`` setting is used in a ``SERVERNAME`` ODBC
8492
connection string component instead of being used in a ``SERVER``
8593
component; this means that this value should be the name of a
8694
*dataserver* definition present in the ``freetds.conf`` FreeTDS
@@ -94,31 +102,33 @@ Standard Django settings
94102
``django-pyodbc``-specific settings
95103
-----------------------------------
96104

97-
``DATABASE_ODBC_DSN``
105+
``ODBC_DSN``
98106
String. A named DSN can be used instead of ``DATABASE_HOST``.
99107

100-
``DATABASE_ODBC_DRIVER``
108+
``ODBC_DRIVER``
101109
String. ODBC Driver to use. Default is ``"SQL Server"`` on Windows and
102110
``"FreeTDS"`` on other platforms.
103111

104-
``DATABASE_EXTRA_PARAMS``
112+
``EXTRA_PARAMS``
105113
String. Additional parameters for the ODBC connection. The format is
106114
``"param=value;param=value"``.
107115

108-
``DATABASE_COLLATION``
116+
``COLLATION``
109117
String. Name of the collation to use when performing text field lookups
110118
against the database. Default value is ``"Latin1_General_CI_AS"``.
111119
For Chinese language you can set it to ``"Chinese_PRC_CI_AS"``.
112120

113121
License
114122
=======
115123

116-
New BSD LICENSE
124+
See LICENSE.
117125

118126
Credits
119127
=======
120128

121-
* Ramiro Morales `<http://djangopeople.net/ramiro/>`_
129+
* Dan Loewenherz
122130
* Filip Wasilewski (http://code.djangoproject.com/ticket/5246)
131+
* Ramiro Morales `<http://djangopeople.net/ramiro/>`_
123132
* Wei guangjing `<http://djangopeople.net/vcc/>`_
124133
* mamcx (http://code.djangoproject.com/ticket/5062)
134+

0 commit comments

Comments
 (0)