To avoid having to manually define the endpoints for each component, you can set the component to be "public" with Component.Url.public = True. This will automatically create a URL for the component. To retrieve the component URL, use get_component_url().
In addition, Component has a render_to_response() method that renders the component template based on the provided input and returns an HttpResponse object.
To avoid having to manually define the endpoints for each component, you can set the component to be "public" with Component.View.public = True. This will automatically create a URL for the component. To retrieve the component URL, use get_component_url().
In addition, Component has a render_to_response() method that renders the component template based on the provided input and returns an HttpResponse object.
If you don't care about the exact URL of the component, you can let django-components manage the URLs for you by setting the Component.Url.public attribute to True:
If you don't care about the exact URL of the component, you can let django-components manage the URLs for you by setting the Component.View.public attribute to True:
This way you don't have to mix your app URLs with component URLs.
\ No newline at end of file
+
This way you don't have to mix your app URLs with component URLs.
\ No newline at end of file
diff --git a/dev/concepts/fundamentals/components_in_python/index.html b/dev/concepts/fundamentals/components_in_python/index.html
index 49861141..9d47e2fc 100644
--- a/dev/concepts/fundamentals/components_in_python/index.html
+++ b/dev/concepts/fundamentals/components_in_python/index.html
@@ -28,7 +28,7 @@
context:Mapping|django.template.Context|None=None,args:List[Any]|None=None,kwargs:Dict[str,Any]|None=None,
-slots:Dict[str,str|SafeString|SlotContent]|None=None,
+slots:Dict[str,str|SafeString|SlotInput]|None=None,escape_slots_content:bool=True)->str:
args - Positional args for the component. This is the same as calling the component as {% component "my_comp" arg1 arg2 ... %}
kwargs - Keyword args for the component. This is the same as calling the component as {% component "my_comp" key1=val1 key2=val2 ... %}
slots - Component slot fills. This is the same as pasing {% fill %} tags to the component. Accepts a dictionary of { slot_name: slot_content } where slot_content can be a string or Slot.
escape_slots_content - Whether the content from slots should be escaped. True by default to prevent XSS attacks. If you disable escaping, you should make sure that any content you pass to the slots is safe, especially if it comes from user input.
context - A context (dictionary or Django's Context) within which the component is rendered. The keys on the context can be accessed from within the template.
NOTE: In "isolated" mode, context is NOT accessible, and data MUST be passed via component's args and kwargs.
request - A Django request object. This is used to enable Django template context_processors to run, allowing for template tags like {% csrf_token %} and variables like {{ debug }}.