cobrateam/splinter

django driver raises ImproperlyConfigured exception

Open

#370 opened on Feb 6, 2015

View on GitHub
 (3 comments) (0 reactions) (0 assignees)Python (509 forks)auto 404
Docsbugdjangohelp wanted

Repository metrics

Stars
 (2,754 stars)
PR merge metrics
 (PR metrics pending)

Description

The django driver raises the following exception:

Python 3.3.5 (default, Jan 17 2015, 23:43:00) 
[GCC 4.8.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from splinter import Browser
>>> browser = Browser('django')
>>> browser.visit('http://example.net')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/lib64/python3.3/site-packages/splinter/driver/djangoclient.py", line 92, in visit
    self._response = self._browser.get(url, follow=True)
  File "/home/user/.local/lib64/python3.3/site-packages/django/test/client.py", line 470, in get
    **extra)
  File "/home/user/.local/lib64/python3.3/site-packages/django/test/client.py", line 286, in get
    return self.generic('GET', path, secure=secure, **r)
  File "/home/user/.local/lib64/python3.3/site-packages/django/test/client.py", line 337, in generic
    data = force_bytes(data, settings.DEFAULT_CHARSET)
  File "/home/user/.local/lib64/python3.3/site-packages/django/conf/__init__.py", line 46, in __getattr__
    self._setup(name)
  File "/home/user/.local/lib64/python3.3/site-packages/django/conf/__init__.py", line 40, in _setup
    % (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_CHARSET, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
>>> 

Any suggestions what went wrong or is it bug?

Contributor guide