Comments (21)
I think we actually serve static (in production) using these and they dont cause any issues. Are you seeing specific problems other than Django 1.3's changes?
from sentry.
No looks good, i just ended up renaming /media/ to /static/ and changing the {% url sentry-media %} to use {{STATIC_URL}} for django 1.3 and that works fine
Maybe a better solution would be to allow the user to override by creating a SENTRY_MEDIA_URL in the settings or something
from sentry.
Going to add in a SENTRY_MEDIA_PREFIX in the next build
from sentry.
heya,
I'm a bit confused - what is the current status on serving up static media then?
For now, I've just manually copied the static assets for sentry (site-packages/sentry/media) into a folder, and I'm serving it with Nginx:
location /sentry/_media/ {
alias /sites/mediatracking.au.db.com/sentry/_media/;
}
I'm on Django 1.3, using staticfiles. Will there be integration then with staticfiles in the next release of django-sentry?
Cheers,
Victor
from sentry.
I forgot about this in the last release. I'll probably do one more minor release with this fix, and then we'll be moving Sentry into Nexus (which handles media in a similar fashion, but has a MEDIA_PREFIX option already)
from sentry.
heya,
Aha, awesome, looking forward to it then =).
So Sentry will be integrated with staticfiles, and it'll get collected with collecstatic? The new way of handling static media in Django 1.3 is so much simpler.
Hmm, I just saw your Nexus project, it seems very cool grins. Definitely going to keep my eyes on this one. Good luck!
Cheers,
Victor
from sentry.
I solved it by using the following in my settings.py
import sentry
STATICFILES_DIRS = (
('sentry', path(sentry.__file__).dirname() / 'media'),
)
from sentry.
When installing Sentry I actually had the same issue, I solved it with an (imho clean) workaround.
I have added an extra url to my urls.py
:
url(
r'^media/sentry/(?P<path>.*)$',
'django.views.static.serve',
{'document_root': os.path.join(sentry_urls.SENTRY_ROOT, 'media')},
name='sentry-media',
),
And symlinked <SENTRY_DIR>/media
to media/sentry
. After that the normal MEDIA_URL
setting does the trick.
This way both the developent and normal settings work just fine. When running through Apache/Nginx it will use the Alias
I've set. When running the development server it uses the build-in static server.
from sentry.
WoLpH: I think that's the wrong way to do it, as it uses django's static file serving, rather than whatever static files serving method is used.
from sentry.
@schinckel: Actually, it doesn't. With the Alias
I have in Apache it overrides the Django url completely. If you don't have the Apache overrides set than it will fallback to Django.
Do note that Django doesn't even allow static media serving with production settings so it wouldn't even work.
from sentry.
Ah, okay. That makes sense.
from sentry.
This has my vote. I could allow nginx to fix this issue but i am in favor of doing it right. SENTRY_MEDIA_PREFIX.
from sentry.
It seems very sad what i learned today about sentry.
It is very wrong solution to use url(r'^_media/(?P.*)$'
Why ? Because some people use django-staticfile, which will be a part of django.contrib in 1.3 (a use it in 1.2)
There are 2 issues:
- django-staticfiles command 'collectstatic' puts all media together in e.g 'static' folder. But sentry stores all media not in sentry/media/sentry/js, sentry/media/sentry/css, sentry/media/sentry/img.
It stores mediafiles in sentry/media/js, etc. This is wrong, because when 'collectstatic' copies media to 'static' folder, it puts media in static/js but not in static/sentry/css - django-staticfiles will serve static files in DEBUG mode. In production web-server should do this
from sentry.
and ofcourse there should be optional SENTRY_MEDIA_PREFIX in settings
from sentry.
I just committed a fix for this in my fork:
https://github.com/brutasse/django-sentry/commit/34ec4ed047e811612751424f6b7e942a6fa9e292
This makes sentry compatible with django-staticfiles and contrib.staticfiles. For django < 1.3, people will need to install django-staticfiles. This probably needs to be documented but django-staticfiles shouldn't be in install_requires.
@dcramer: what do you think about moving nexus / sentry's media handling to the django-staticfiles way? This is becoming the standard for app-provided static files and really simplifies the process for users. Let me know if I need to open a pull request, I wanted to discuss it here first.
from sentry.
Will pull in your patch as soon as I bust out the git-capable machine.
Regarding staticfiles, it will probably happen, but doing it within Nexus as a whole is a bit more complicated. We want to support a bunch of frameworks in Nexus, which means the default way will just be having our own custom static serving code, but ideally falling back to platform-specifics when it can.
from sentry.
Ok. I realized I forgot to edit the MANIFEST file after the media -> static/sentry change, so there's an additional commit to cherry-pick:
https://github.com/brutasse/django-sentry/commit/22ce7f7f876d6d5a0d5b9e5fcbb1ee731303a9f8
from sentry.
Added support for staticfiles (without removing default media serving) in dcramer/django-sentry@b286099
from sentry.
NICE! Thanks David.
from sentry.
Hi,
I no longer can find this setting, is this gone again ?
Thanks
from sentry.
I too am basically seeing no way to configure this setting, not to mention that the media just plain doesn't load for me. I'm using the lastest version from cheeseshop and also just tried the github trunk
from sentry.
Related Issues (20)
- Can’t group by environment
- Min agg bugs
- ingestion bug
- Check the tooltip guides on new inputs if still make sense
- span.duration should be selected by default
- Cardinality warning in modal should be near groupbys, not filters
- Plotting built-in span.duration let’s me filter on “span.description”, which only seems to work on the samples table and the line on the chart disappears HOT 2
- span.description values have weird three dots in them
- transaction is not a tag on span.duration HOT 1
- *Placeholder* Spans taking 12h
- Hide summary legend table if there's no data
- [Metrics] Mutually exclusive tag filters break equations HOT 3
- Sentry request body hides empty dictionary keys HOT 2
- [DevToolbar] Allow overriding UI featureflags from within the devtoolbar
- [DevToolbar] Show an indicator on the Open/Close Releases button that indicates whether the latest release has more or less crashes than the prev release
- Alert timeseries visualization trend should not disable when alert silenced. HOT 2
- Sentry Discover Tab + Events list is missing events while "Since issue began" accumulated count of events is correct HOT 1
- Sentry issues endpoint is returning incorrect value for annotations field HOT 4
- Cannot Page Through Projects Debug Files HOT 4
- Performance unit exceeded warning link returns 404 HOT 3
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 sentry.