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 driver raises ImproperlyConfigured exception #370

Open
elya5 opened this issue Feb 6, 2015 · 3 comments
Open

django driver raises ImproperlyConfigured exception #370

elya5 opened this issue Feb 6, 2015 · 3 comments
Labels
bug django Relates to the Django client Docs help wanted

Comments

@elya5
Copy link

elya5 commented Feb 6, 2015

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?

@elya5
Copy link
Author

elya5 commented Feb 21, 2015

The splinter version is 0.7.0 and the django version is 1.7.4

@lucasmagnum-luizalabs
Copy link

@elya5 are you using python manage.py shell command?

@elya5
Copy link
Author

elya5 commented Feb 25, 2015

@lucasmagnum-luizalabs so I tried it with python manage.py shell and it works. Does that I mean I always have to start a django project to use django as a headless driver for splinter. It should be mentioned in the documentation then.

@jsfehler jsfehler added the django Relates to the Django client label Mar 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug django Relates to the Django client Docs help wanted
Projects
None yet
Development

No branches or pull requests

4 participants