Closed deshipu closed 10 years ago
Hmm, seems like my minimal example works just fine. There must be some other problem.
Hi @deshipu,
If I remember correctly, django-pyscss will log a warning if it can't find a file to import. If you turn up the logging level to DEBUG, you can also see the search paths that it's doing for the imports.
I wish I could throw exceptions, but I wanted to keep the style that PyScss had.
Thank you for the advice, I will try it again tomorrow. You guys are great with the quick responses.
All I'm getting is:
File to import not found or unreadable: '/bootstrap/scss/bootstrap' (<string u'// bootstrap overrides:\n$icon-font-path: "../../bo'...>:0)
But if I go to http://myserver/static/scss/bootstrap.scss
I get the file correctly...
I will investigate further...
Are there any DEBUG level messages? _find_source_file logs the paths it's searching.
Well, it shows all the possible filename extensions, but those are not absolute filesystem paths, so I have no way of verifying that it looks in the right directory.
I noticed that it works fine if the prefix in STATICFILES_DIRS
is set to ""
(empty string). This is most likely some interaction with our particular setup or one of the libraries that we use -- I wrote a small Django app that works correctly even with non-empty prefixes.
I finally have a working minimal example that reproduces the issue, but I still don't see how to fix it. The code is here: https://github.com/deshipu/django-pyscss-test
To see the problem:
git clone https://github.com/deshipu/django-pyscss-test
cd django-pyscss-test
virtualenv --system-site-packages venv
venv/bin/python manage.py runserver
xdg-open http://127.0.0.1:8080
The text should be red, but is not. You can also run:
venv/bin/python manage.py compress --force
To see that the generated css has no rules.
The interesting part is that if you remove "blue" both from the @import
and from STATICFILES_DIRS
, it works fine.
I just discovered that it also works when you remove "blue" just from the @import
and leave it in STATICFILES_DIRS
. Looks like django-pyscss is just ignoring those prefixes.
I'm probably doing something wrong, because this is what django-pyscss is supposed to do, but I can't get it to work with
STATICFILES_DIRS
. Long story short, we have removed our bootstrap scss files from our repository, and packaged them in a separate packaged, which we then import insettings.py
and add the directory with all the files toSTATICFILES_DIRS
with correct prefix. Django-pyscss fails to find those files. It also fails to report the failure and just behaves as if everything went fine -- until you try to use any of the variables defined in those files.Here is a link to the patch with the issue: https://review.openstack.org/#/c/116583/
I will prepare a minimal Django app that demonstrates the problem.