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

Silk's static assets are served from the wrong path #11

Closed
mattandrews opened this issue Jun 7, 2014 · 7 comments
Closed

Silk's static assets are served from the wrong path #11

mattandrews opened this issue Jun 7, 2014 · 7 comments

Comments

@mattandrews
Copy link

This could just be my setup, but Silk's template uses file paths like:

<link rel="stylesheet" href="/static/silk/css/fonts.css"/>

On my machine, this translates to a request for http://127.0.0.1:8000/static/silk/css/fonts.css which doesn't load. I would've expected Silk to use my existing STATIC_URL as a prefix for these files.

(I realise Silk is probably meant for production not local usage, but I'm curious about what it does before I deploy it anywhere)

@mtford90
Copy link
Collaborator

mtford90 commented Jun 7, 2014

Hi Matt,

You're right. Rather than use /static/silk I just moved everything over to using the staticfiles inclusion tags detailed here. This will use the configured STATICFILES_STORAGE and hence the STATIC_URL that you have configured (I believe).

The changes are in master so if you install via pip install -e git+https://github.com/mtford90/silk.git#egg=silk and let me know if it works with your setup, that would be great!

--Mike

@mattandrews
Copy link
Author

Thanks Mike.

I tried this, but get this error:

TemplateDoesNotExist at /silk/
silk/templates/silk/base/root_base.html

Have tried removing existing silk and installing via your command above.

I've upgraded from Django 1.4.2 to 1.5.7 (to get Silk to work) so it's possible I'm missing some settings – I don't have STATICFILES_STORAGE, for one thing... let me see if I can add that and get it working.

@mattandrews
Copy link
Author

Further error info:
Template-loader postmortem

Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/Users/matt/Dev/www/spb-django/spb/webzine/templates/silk/templates/silk/base/root_base.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/Users/matt/Dev/www/spb-django/ve/lib/python2.7/site-packages/django/contrib/auth/templates/silk/templates/silk/base/root_base.html (File does not exist)
/Users/matt/Dev/www/spb-django/ve/lib/python2.7/site-packages/django/contrib/admin/templates/silk/templates/silk/base/root_base.html (File does not exist)
/Users/matt/Dev/www/spb-django/spb/webzine/templates/silk/templates/silk/base/root_base.html (File does not exist)
/Users/matt/Dev/www/spb-django/ve/lib/python2.7/site-packages/debug_toolbar/templates/silk/templates/silk/base/root_base.html (File does not exist)
/Users/matt/Dev/www/spb-django/ve/src/silk/silk/templates/silk/templates/silk/base/root_base.html (File does not exist)

@mtford90
Copy link
Collaborator

Hi Matt, master is broken for 1.5 atm - something to do with differences in how templates and namespaces are handled. I managed to break compatibility whilst integrating django-auth... The fix for the static files issue that was originally causing you issues is in 0.1.1 on pypi though, so if you install the latest using pip it should hopefully work!

Let me know.

@mtford90
Copy link
Collaborator

Hi Matt,

Was this is issue solved in the end?

@mattandrews
Copy link
Author

Hi Michael – sorry for the super late reply, just got back from holiday.

I added 0.1.1 as a dependency and it now looks good – thank you! Will enjoy checking out what the tool can do :)

@mtford90
Copy link
Collaborator

mtford90 commented Jul 2, 2014

No worries, hope you had a good one!

FYI its now up to v0.3 - the improved filtering makes it much more useful.

pablodiazgutierrez pushed a commit to appfluence/django-silk that referenced this issue Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants