Comments (7)
Relavant sections :
from django-components.
Stacktrace :
Internal Server Error: /anime/
Traceback (most recent call last):
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Programming\coreproject-elixir\CoreProject\backend\django_core\apps\pages\views\anime.py", line 31, in anime_home_view
return render(request, "anime/home.html", context={"icons": icons})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\shortcuts.py", line 24, in render
content = loader.render_to_string(template_name, context, request, using=using)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\loader.py", line 62, in render_to_string
return template.render(context, request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\backends\django.py", line 61, in render
return self.template.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\base.py", line 175, in render
return self._render(context)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\test\utils.py", line 112, in instrumented_test_render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\base.py", line 1005, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\base.py", line 1005, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\base.py", line 966, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\loader_tags.py", line 157, in render
return compiled_parent._render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\test\utils.py", line 112, in instrumented_test_render
return self.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\base.py", line 1005, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\base.py", line 1005, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\base.py", line 966, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\loader_tags.py", line 63, in render
result = block.nodelist.render(context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\base.py", line 1005, in render
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\base.py", line 1005, in <listcomp>
return SafeString("".join([node.render_annotated(context) for node in self]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django\template\base.py", line 966, in render_annotated
return self.render(context)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django_components\templatetags\component_tags.py", line 422, in render
component_cls: Type[Component] = component_registry.get(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\baseplate-admin\AppData\Local\pypoetry\Cache\virtualenvs\coreproject-1UeyYTYF-py3.11\Lib\site-packages\django_components\component_registry.py", line 28, in get
raise NotRegistered('The component "%s" is not registered' % name)
django_components.component_registry.NotRegistered: The component "vercel_hover" is not registered
from django-components.
Hi! Thanks for providing enough context to properly help you find the problem.
All the setup seems to work like it should (the component tag is found for instance). Instead, the problem is that your vercel_hover component isn't found. The code for finding the components is here: https://github.com/EmilStenstrom/django-components/blob/master/django_components/__init__.py#L17
As you see, it looks for a component directory in each app you have, and otherwise falls back to your "libraries" setting which you can find docs for here: https://github.com/EmilStenstrom/django-components#configure-the-module-where-components-are-loaded-from
All in all, I think the solution is as simple as pointing to your components dir with the libraries settings.
Can you get it working?
from django-components.
Yep, Sorry for late reply.
I see the error.
This structure works
While this one doesn't
Is it possible to specify the parent directory for components?
Thanks a bunch
from django-components.
So, did you try the libraries setting i mentioned above?
from django-components.
So, did you try the libraries setting i mentioned above?
Yep i did, Specifically this. It works !
But if i have hundreds of modules, it would be a bit tedious to load them one by one, no?
from django-components.
This issue is resolved. Thanks for your help @EmilStenstrom
from django-components.
Related Issues (20)
- JS and CSS not loading HOT 2
- Global context not available when rendering via view methods with RequestContext HOT 5
- Auto-reload server when saving component file
- Allow dynamic slots and fills HOT 1
- Template caching isn't working HOT 1
- Allow different apps to have different settings HOT 1
- Invalid block tag ... 'component'. Did you forget to register or load this tag? error HOT 20
- Warnings (probably errors) when building documentation HOT 3
- Allow dynamic components HOT 5
- feat: React-like render functions (or functional components) and CachedTemplate HOT 3
- Use variables in JS / CSS and caching thereof HOT 15
- Release 0.93 did not trigger documentation build HOT 6
- Hook into the render process to allow to modify the rendered content HOT 1
- RequestContext not populated with context processors on async request HOT 4
- First class support for HTML fragments HOT 9
- Support for AlpineJS in slots HOT 3
- Broken link in documentation HOT 2
- Docs not deployed to gh-CDN HOT 5
- Crazy idea: Auto-convert RadixUI from JSX to django-components with LLM? HOT 3
- Unexpected behaviour of `ComponentDependencyMiddleware` in combination with `as_view` usage HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-components.