Skip to content

Django: Instrumentation can get activated even when django not in use #192

@pglombardo

Description

@pglombardo

Just having the Django package in sys.modules (but without a running Django app) causes the following cosmetic error:

2019-10-17 12:24:28,705: 1 DEBUG instana: Instrumenting django
2019-10-17 12:24:28,944: 1 DEBUG instana: django.middleware:
Traceback (most recent call last):
  File "/tmp/instana/python/instana/instrumentation/django/middleware.py", line 133, in <module>
    wsgiapp = get_internal_wsgi_application()
  File "/usr/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 42, in get_internal_wsgi_application
    app_path = getattr(settings, 'WSGI_APPLICATION')
  File "/usr/local/lib/python2.7/site-packages/django/conf/__init__.py", line 56, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/site-packages/django/conf/__init__.py", line 39, in _setup
    % (desc, ENVIRONMENT_VARIABLE))
ImproperlyConfigured: Requested setting WSGI_APPLICATION, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions