Giter VIP home page Giter VIP logo

Comments (7)

baseplate-admin avatar baseplate-admin commented on September 25, 2024

Relavant sections :

https://github.com/baseplate-admin/CoreProject/blob/43956143324fa98537285d8a237366aa2b6fb997/backend/django_core/core/settings.py#L79-L80

https://github.com/baseplate-admin/CoreProject/blob/43956143324fa98537285d8a237366aa2b6fb997/backend/django_core/core/settings.py#L207-L226

https://github.com/baseplate-admin/CoreProject/blob/43956143324fa98537285d8a237366aa2b6fb997/backend/django_core/core/settings.py#L334

from django-components.

baseplate-admin avatar baseplate-admin commented on September 25, 2024

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.

EmilStenstrom avatar EmilStenstrom commented on September 25, 2024

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.

baseplate-admin avatar baseplate-admin commented on September 25, 2024

Yep, Sorry for late reply.

I see the error.

image

This structure works

While this one doesn't

image

Is it possible to specify the parent directory for components?

Thanks a bunch

from django-components.

EmilStenstrom avatar EmilStenstrom commented on September 25, 2024

So, did you try the libraries setting i mentioned above?

from django-components.

baseplate-admin avatar baseplate-admin commented on September 25, 2024

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.

baseplate-admin avatar baseplate-admin commented on September 25, 2024

This issue is resolved. Thanks for your help @EmilStenstrom

from django-components.

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.