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

JS and CSS not loading #577

Open
mikko-ahonen opened this issue Aug 12, 2024 · 2 comments
Open

JS and CSS not loading #577

mikko-ahonen opened this issue Aug 12, 2024 · 2 comments

Comments

@mikko-ahonen
Copy link

mikko-ahonen commented Aug 12, 2024

I added django components to another project and for some reason I just cannot get it to load CSS and JS dependencies.

I even tried the older version, but apparently I get the same result.

If I include the tags
{% component_css_dependencies %}
and
{% component_js_dependencies %}

I just see these on the HTML:

<script name="JS_PLACEHOLDER"></script>

If I omit the tag, I see nothing.

These tags are not mentioned in the installation, btw, should they be used or not?

I tried both inlining the JS and loading from template, does not seem to make a differenece.

The server is properly serving the files, i.e. I can see

http://127.0.0.1:8000/static/status_board/status_board.py
http://127.0.0.1:8000/static/status_board/status_board.html
http://127.0.0.1:8000/static/status_board/status_board.js
http://127.0.0.1:8000/static/status_board/status_board.css

@EmilStenstrom
Copy link
Owner

Hi! Here's the docs for those three tags: https://github.com/EmilStenstrom/django-components?tab=readme-ov-file#rendering-jscss-dependencies

I'm wondering: Have you set RENDER_DEPENDENCIES without enabling the middleware?

@EmilStenstrom
Copy link
Owner

ping @mikko-ahonen

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