Coder Social home page Coder Social logo

Comments (9)

jrief avatar jrief commented on July 22, 2024

You don't need django-cms, only django-sekizai.
And the link must be inside a {% addtoblock "css" preprocessor "..." %}<link href="...file.scss" ... />{% endaddtoblock %}.

Did you do that?

from django-sass-processor.

goanpeca avatar goanpeca commented on July 22, 2024

Hi, I meant I am new to django (not to python) and I am also new to django-cms, and I am using it for a project right now.

I used as the example

{% addtoblock "css" preprocessor "sekizai_processors.sass_preprocessor.compilescss" %}<link href="{% static 'css/styles.scss' %}" rel="stylesheet" type="text/css" />{% endaddtoblock %}

I stored the raw scss file in a global static folder where I also have other assets (fancyboxes .. ythings like that)

And when rendering the page it transforms to

<link href="/static/css/mystyle.css" rel="stylesheet" type="text/css" />

And it saves two new files in public/static/css which is the STATIC_ROOT, but on development apparently this is not resolved?

I am working locally for the moment (linux...) and when clicking on the source of the rendered <link ... it raises a 404 page

from django-sass-processor.

jrief avatar jrief commented on July 22, 2024

During development, the compiled file is placed into STATIC_ROOT in order to not pollute your local static/css/ folder with auto-generated files.
Therefore assure, that in your settings STATIC_ROOT points to an accessible folder and that a finder finds that file. I'm currently using the CompressorFinder.
Please retest with

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'compressor.finders.CompressorFinder',
)

sorry, I forgot to add this to the docs.

from django-sass-processor.

goanpeca avatar goanpeca commented on July 22, 2024

Hi thanks for the answer :)

Indeed that solved the problem, BUT now another question is:

The file should regenerate (if younger) only when restarting the local development server? or any time a page is refreshed (and the scss has time stamps younger that the generated css)? I am only getting a new file if I delete the previously generated one(s)...

Docs

Did you mean load sekizai_tags in https://github.com/jrief/django-sekizai-processors#in-your-django-templates ?

from django-sass-processor.

jrief avatar jrief commented on July 22, 2024

No it should regenerate whenever any of the depending *.scss files changes and the timestamps are younger. But this is done, when parsing the template.

I am only getting a new file if I delete the previously generated one(s)...

make sure, that no cache is in between, otherwise the template is served from the cache.

If your settings has something such as:

MIDDLEWARE_CLASSES = (
    'django.middleware.cache.UpdateCacheMiddleware',
   ...
    'django.middleware.cache.FetchFromCacheMiddleware',
)

you'd have to restart the server after each change - presumably not what you want.

Did you mean load sekizai_tags

Sure! Typo hell.

from django-sass-processor.

goanpeca avatar goanpeca commented on July 22, 2024

Great :), all fixed now. Thanks for the quick answers

from django-sass-processor.

jrief avatar jrief commented on July 22, 2024

Early adopters fix the first bugs.
Thanks for reporting and please rate this project.

from django-sass-processor.

jrief avatar jrief commented on July 22, 2024

Sekizai is not required anymore.
This now is a stand-alone project and has been renamed to django-sass-processor.
It now should aim for a much bigger audience.
Sorry for the inconvenience having broken the API.

from django-sass-processor.

goanpeca avatar goanpeca commented on July 22, 2024

Great :), indeed is for the best, my setup is updated 👍 thanks for the headsup and keep up the great work

from django-sass-processor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.