WilliamRen / django-pyodbc

Automatically exported from code.google.com/p/django-pyodbc
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

django-pyodbc connection failure. #113

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. On Windows 7 PC
2. Python 2.7 installed
3. Install django-1.3.1
4. Install pyodbc for 2.7
5. Install django-pyodbc via svn 
6. Update PYTHONPATH to include django-pyodbc home
7. run django-admin.py startproject testsite4
8. cd testsite4
9. run python manage.py syncdb on created project

What is the expected output? What do you see instead?

Database files created on sql server 2005 database

I get:
Traceback (most recent call last):
  File "manage.py", line 14, in <module>
    execute_manager(settings)
  File "c:\python27\lib\site-packages\django\core\management\__init__.py", line
438, in execute_manager
    utility.execute()
  File "c:\python27\lib\site-packages\django\core\management\__init__.py", line
379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "c:\python27\lib\site-packages\django\core\management\__init__.py", line
261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "c:\python27\lib\site-packages\django\core\management\__init__.py", line
67, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "c:\python27\lib\site-packages\django\utils\importlib.py", line 35, in im
port_module
    __import__(name)
  File "c:\python27\lib\site-packages\django\core\management\commands\syncdb.py"
, line 7, in <module>
    from django.core.management.sql import custom_sql_for_model, emit_post_sync_
signal
  File "c:\python27\lib\site-packages\django\core\management\sql.py", line 6, in
 <module>
    from django.db import models
  File "c:\python27\lib\site-packages\django\db\__init__.py", line 78, in <modul
e>
    connection = connections[DEFAULT_DB_ALIAS]
  File "c:\python27\lib\site-packages\django\db\utils.py", line 93, in __getitem
__
    backend = load_backend(db['ENGINE'])
  File "c:\python27\lib\site-packages\django\db\utils.py", line 51, in load_back
end
    raise ImproperlyConfigured(error_msg)

Thanks,

Mike
django.core.exceptions.ImproperlyConfigured: 'sql_server.pyodbc' isn't an availa
ble database backend.
Try using django.db.backends.XXX, where XXX is one of:
    'dummy', 'mysql', 'oracle', 'postgresql', 'postgresql_psycopg2', 'sqlite3'
Error was: No module named sql_server.pyodbc.base

What version of the product are you using? On what operating system?
Windows 7, lastest sp
SQL Server 2005 sp3 
django 1.3.1
python 2.7
django-pyodbc-read-only from snv

Please provide any additional information below.

Here is my relevent setting.py

DATABASES = {
    'default': {
        'ENGINE': 'sql_server.pyodbc', 
        'DATABASE_NAME': 'django',
        'DATABASE_HOST': 'delsql01',
        'DATABASE_USER': 'sa',                      
        'DATABASE_PASSWORD': 'D3ltr0l',
        'DATABASE_OPTIONS' : {'driver': 'SQL Native Client', 'MARS_Connection': True,}      #
    }
}

Original issue reported on code.google.com by mzo...@gmail.com on 19 Sep 2011 at 6:33