Comments (6)
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.
@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.
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.
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.
[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.
@bjomi please re-open with additional details. Closing for now waiting for more information
from applicationinsights-python.
Related Issues (20)
- Log level cannot be configured through `logging_level` argument HOT 1
- Vendor instrumentations
- Add custom exporter support for all pillars HOT 1
- Separate Attach logic into new package that depends on distro HOT 1
- Add documentation for useful instrumentation configurations. HOT 1
- This repo is missing important files HOT 1
- Confirm licensing approach for vendoring is correct HOT 1
- Support for OpenTelemetry instrumentation aiohttp-client HOT 2
- Support for OpenTelemetry instrumentation grpc HOT 2
- Benefit from this package without using AzureInsights? (Offline Use within docker-compose?) HOT 4
- Inbound requests to FastAPI Route are not getting logged in App Insights HOT 3
- No tracing with Opentelemetry distro for Azure + Python + Fastapi HOT 3
- Unwanted dependencies are tracked which are not required HOT 3
- Not able to set cloudrole name HOT 3
- Flask auto-instrumentation doesn't configure itself properly HOT 9
- No insights in application map from sample code correlated logs HOT 2
- 'MessageData' is required but missing or empty HOT 3
- What's the problem with duplicated logs? HOT 12
- Too much traces in AppInsights HOT 8
- Resource error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from applicationinsights-python.