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

Error if settings miss OPTIONS key #44

Open
mylh opened this issue Jan 9, 2014 · 3 comments
Open

Error if settings miss OPTIONS key #44

mylh opened this issue Jan 9, 2014 · 3 comments

Comments

@mylh
Copy link

mylh commented Jan 9, 2014

In DatabaseWrapper class in init method self.settings only defined if options is not None

so if we don't have OPTIONS key in settings then we've got an error in _cursor method return statement:

return CursorWrapper(cursor, self.driver_supports_utf8, self.encoding)

because self.encofing is never defined.

@dlo dlo added the bug label Apr 22, 2014
@wraila
Copy link

wraila commented Nov 6, 2014

I have been unable to run the django-pyodbc tests because of this. How do I create the OPTIONS to fix this?

@DavisGoglin
Copy link

You just have to define an options key in the configuration. Something like

DATABASES = {
    'dbname': {
        'ENGINE': 'django_pyodbc',
        'HOST': 'hostname',
        'USER': 'user',
        'PASSWORD': 'pw',
        'NAME': 'name',
        'OPTIONS': {
            'placeholder': 'https://github.com/lionheart/django-pyodbc/issues/44'
        }
    }
}

@wraila
Copy link

wraila commented Nov 7, 2014

Perfect. Thanks.

From: Davis Goglin [mailto:[email protected]]
Sent: Thursday, November 06, 2014 6:05 PM
To: lionheart/django-pyodbc
Cc: Raila, Wayne F.
Subject: Re: [django-pyodbc] Error if settings miss OPTIONS key (#44)

You just have to define an options key in the configuration. Something like

DATABASES = {

'dbname': {

    'ENGINE': 'django_pyodbc',

    'HOST': 'hostname',

    'USER': 'user',

    'PASSWORD': 'pw',

    'NAME': 'name',

    'OPTIONS': {

        'placeholder': 'https://github.com/lionheart/django-pyodbc/issues/44'

    }

}

}


Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-62068065.

The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

@dlo dlo added the help wanted label Feb 1, 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

4 participants