Giter Club home page Giter Club logo

Comments (6)

jjjordanmsft avatar jjjordanmsft commented on May 13, 2024

A few questions:

What version of Django are you running?
How is it installed? (virtualenv, something else?)
How are you encountering this? (The builtin django test server? uWSGI?)

from applicationinsights-python.

bjomi avatar bjomi commented on May 13, 2024

@jjjordanmsft thanks for gettings back!

Django version: 1.10.7
It is installed in virtualenv.
I'm encountering this both locally running the djagno test server and in Azure via WSGI.

from applicationinsights-python.

jjjordanmsft avatar jjjordanmsft commented on May 13, 2024

Could you elaborate on how this application is set up and deployed?

The error message that you are pasting indicates that django found the appinsights module, but the appinsights module can't find django. This sort of problem is usually due to an incorrectly set PYTHONPATH. But it's hard to tell yet.

Can you run manage.py shell and try this check (with and without the application insights middleware in your settings):

>>> import django
>>> django.setup()
>>> from applicationinsights.django import create_client
>>> cl = create_client()
>>> cl.context.instrumentation_key

EDIT: perhaps blank out the instrumentation key rather than pasting it to github
EDIT 2: Better steps

from applicationinsights-python.

bjomi avatar bjomi commented on May 13, 2024

Thanks for trying to sort this out!

So, this occurs both in local dev mode and when deployed. The site is deployed with a custom deploy script using the "deployment options" in the azure web app.

I did the steps you suggested in the shell and in both cases (with and without application insights middleware) it fails on the third line and throws the following error:

ImportError: No module named django

I have a lot of other dependencies for this project and there have not been any problems like this with them. So something must have gone wrong here. Dependencies are managed through pip. Could the applicationinsights pip package have a dependency that has not been installed? I am really kind of lost here.

from applicationinsights-python.

jjjordanmsft avatar jjjordanmsft commented on May 13, 2024

[Sorry, I dropped this on the floor after I went for vacation.]

The package doesn't have any explicit pypi dependencies. It implicitly depends on Django, but as it needs to work with a variety of Django releases, we can't point to any specific version.

I took a look around at some other middlewares, and I don't think we're doing anything that's not common elsewhere. However we may be conflicting with something else in a strange way. If you don't mind sharing a few more details... could you point me at what other middlewares you're using? What are some of the other dependencies?

I understand this might be somewhat sensitive but I am interested in getting to the bottom of this. You can reach out to me via email if you prefer: jjjordan at my company's domain.

from applicationinsights-python.

SergeyKanzhelev avatar SergeyKanzhelev commented on May 13, 2024

@bjomi please re-open with additional details. Closing for now waiting for more information

from applicationinsights-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.