fusionbox / django-pyscss

Makes it easier to use PyScss in Django
https://pypi.python.org/pypi/django-pyscss
BSD 2-Clause "Simplified" License
19 stars 13 forks source link

import not finding inside app #42

Closed garcianavalon closed 8 years ago

garcianavalon commented 8 years ago

Hi,

I am trying to import a scss file from one of my apps from my main .scss file. If I try @import "/myapp/css/myfile.scss";works fine but if I try @import "myfile.scss";it doesn't find it, showing me the error:

SassImportError at /myapp/base/
Couldn't find anything to import: myfile.scss
Extensions: <DjangoExtension>, <CompassExtension>
Search path:

on line 1 of css/main.scss

Any idea of what can be going on? Thanks for your help :)

rockymeza commented 8 years ago

Hi!

what's the path to your main.scss file? We try to support relative imports, I'm wondering if they are not in the same path?

-rocky

On Tue, Oct 20, 2015 at 9:17 PM, Enrique García Navalón < notifications@github.com> wrote:

Hi,

I am trying to import a scss file from one of my apps from my main .scss file. If I try @import "/myapp/css/myfile.scss";works fine but if I try @import "myfile.scss";it doesn't find it, showing me the error:

SassImportError at /myapp/base/ Couldn't find anything to import: myfile.scss Extensions: , Search path:

on line 1 of css/main.scss

Any idea of what can be going on? Thanks for your help :)

— Reply to this email directly or view it on GitHub https://github.com/fusionbox/django-pyscss/issues/42.

garcianavalon commented 8 years ago

my project structure:

thanks for your help

rockymeza commented 8 years ago

Hi Enrique,

What's going on here is that your CSS folks are not in the same "directory". If you were to run collectstatic, your files would be:

If you want to import "myfile.scss" you need to specify the full path. Alternatively, you could reorganize your directory structure (not that I'm recommending this):

project > static > css > main.scss myapp > static > css > myapp > myfile.scss

This way you could import "myapp/myfile.scss".

Does this help?

-rocky 2015年10月22日 下午6:00,"Enrique García Navalón" notifications@github.com写道:

my project structure:

  • project
    • static
    • css
      • main.scss
    • img
    • myapp
    • static
    • myapp
      • css
      • myfile.scss

thanks for your help

— Reply to this email directly or view it on GitHub https://github.com/fusionbox/django-pyscss/issues/42#issuecomment-150167196 .

garcianavalon commented 8 years ago

Hi Rocky,

yeah, it helps, thank you. I don't know if I like reorganizing the directory structure, there are pros and cons about it, but now I know whats going on and how to think about it.

Cheers!

rockymeza commented 8 years ago

Hi @garcianavalon, I'm going to go ahead and close this issue. If you think we should keep it open, just let me know!

Thanks!