Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 2.0 Alpha inspectdb command fails #156

Open
brianedelman opened this issue Feb 23, 2018 · 0 comments
Open

Django 2.0 Alpha inspectdb command fails #156

brianedelman opened this issue Feb 23, 2018 · 0 comments

Comments

@brianedelman
Copy link

brianedelman commented Feb 23, 2018

Using the new Alpha support for Django 2.0, inspect db command is failing with django-pyodbc set up.

I am able to make the command work by rolling django-pyodbc back to 1.1.3 and Django to 1.10

Here is the error for 2.0

Traceback (most recent call last):
  File "./manage.py", line 14, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/brianedelman/.virtualenvs/lacma/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/Users/brianedelman/.virtualenvs/lacma/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/brianedelman/.virtualenvs/lacma/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/brianedelman/.virtualenvs/lacma/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
    output = self.handle(*args, **options)
  File "/Users/brianedelman/.virtualenvs/lacma/lib/python3.6/site-packages/django/core/management/commands/inspectdb.py", line 28, in handle
    for line in self.handle_inspection(options):
  File "/Users/brianedelman/.virtualenvs/lacma/lib/python3.6/site-packages/django/core/management/commands/inspectdb.py", line 44, in handle_inspection
    with connection.cursor() as cursor:
AttributeError: __enter__

My server set up is mssql

DATABASES = {
   'default': {
       'ENGINE': "django_pyodbc",
       'HOST': "HOST",
       'USER': "USER",
       'PASSWORD': "PASSWORD",
       'NAME': "DB",
       'OPTIONS': {
            'host_is_server': True,
            'unicode_results': True,
            'extra_params': 'tds_version=8.0'
       },
   }
}
@dlo dlo assigned dlo and unassigned dlo Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants