{{ price }}
{% endif %}
### Install Django Cotton using pip Source: https://django-cotton.com/docs/quickstart This command installs the django-cotton package using pip. It's the first step in setting up Cotton in your Django project. ```bash pip install django-cotton ``` -------------------------------- ### Base Layout Example (HTML) Source: https://django-cotton.com/docs/layouts Defines a basic HTML structure for a layout, using `{{ slot }}` as a placeholder for content. This serves as the foundation for other layout variants. ```html
... {{ slot }} ``` -------------------------------- ### Example Component File Paths based on Naming Convention Source: https://django-cotton.com/docs/configuration Illustrates the expected file paths for a component named 'my-button' based on the COTTON_SNAKE_CASED_NAMES setting in Django's settings.py. ```text Component Usage:Lorem ipsum ...
Some content
Some content
{% endcotton %} ``` -------------------------------- ### Dynamic Component Loading with `:is` Source: https://django-cotton.com/docs/components Illustrates how to dynamically load components in Django Cotton using the `:is` attribute. This allows the component to be determined by a variable or template expression, enabling flexible UI rendering. ```html{{ slot }}
``` -------------------------------- ### Dynamic Component Inclusion with `It's {{ today.temperature }}o{{ today.unit }} and the condition is {{ today.condition }}.
``` -------------------------------- ### Pass Lists to Cotton Component Source: https://django-cotton.com/docs/components Demonstrates passing a Python list as a prop to a Cotton component. This allows components to receive collections of items for iteration or display. ```html{{ slot }}