diff --git a/dev/overview/welcome/index.html b/dev/overview/welcome/index.html index 05988ccf..1d566bf2 100644 --- a/dev/overview/welcome/index.html +++ b/dev/overview/welcome/index.html @@ -1,4 +1,4 @@ - Welcome to Django Components - Django-Components
Skip to content

Welcome to Django Components

django-components

PyPI - Version PyPI - Python Version PyPI - License PyPI - Downloads GitHub Actions Workflow Status asv

django-components combines Django's templating system with the modularity seen in modern frontend frameworks like Vue or React.

With django-components you can support Django projects small and large without leaving the Django ecosystem.

Quickstart¤

A component in django-components can be as simple as a Django template and Python code to declare the component:

components/calendar/calendar.html
<div class="calendar">
+ Welcome to Django Components - Django-Components      

Welcome to Django Components

django-components

PyPI - Version PyPI - Python Version PyPI - License PyPI - Downloads GitHub Actions Workflow Status asv

django-components combines Django's templating system with the modularity seen in modern frontend frameworks like Vue or React.

With django-components you can support Django projects small and large without leaving the Django ecosystem.

Quickstart¤

A component in django-components can be as simple as a Django template and Python code to declare the component:

components/calendar/calendar.html
<div class="calendar">
   Today's date is <span>{{ date }}</span>
 </div>
 
components/calendar/calendar.py
from django_components import Component
@@ -199,4 +199,4 @@
 
 {% calendar date="2024-11-06" %}
 {% endcalendar %}
-

Other features¤

  • Vue-like provide / inject system

Performance¤

Our aim is to be at least as fast as Django templates.

As of 0.130, django-components is ~4x slower than Django templates.

Render time
django 68.9±0.6ms
django-components 259±4ms

See the full performance breakdown for more information.

Release notes¤

Read the Release Notes to see the latest features and fixes.

Community examples¤

One of our goals with django-components is to make it easy to share components between projects. Head over to the Community examples to see some examples.

Contributing and development¤

Get involved or sponsor this project - See here

Running django-components locally for development - See here

\ No newline at end of file +

Other features¤

  • Vue-like provide / inject system

Performance¤

Our aim is to be at least as fast as Django templates.

As of 0.130, django-components is ~4x slower than Django templates.

Render time
django 68.9±0.6ms
django-components 259±4ms

See the full performance breakdown for more information.

Release notes¤

Read the Release Notes to see the latest features and fixes.

Community examples¤

One of our goals with django-components is to make it easy to share components between projects. Head over to the Community examples to see some examples.

Contributing and development¤

Get involved or sponsor this project - See here

Running django-components locally for development - See here

\ No newline at end of file diff --git a/dev/reference/testing_api/index.html b/dev/reference/testing_api/index.html index 9f690e97..7275f39b 100644 --- a/dev/reference/testing_api/index.html +++ b/dev/reference/testing_api/index.html @@ -13,7 +13,7 @@ ] = None, gc_collect: bool = True, ) -> Callable -

See source code

Decorator for testing components from django-components.

@djc_test manages the global state of django-components, ensuring that each test is properly isolated and that components registered in one test do not affect other tests.

This decorator can be applied to a function, method, or a class. If applied to a class, it will search for all methods that start with test_, and apply the decorator to them. This is applied recursively to nested classes as well.

Examples:

Applying to a function:

from django_components.testing import djc_test
+

See source code

Decorator for testing components from django-components.

@djc_test manages the global state of django-components, ensuring that each test is properly isolated and that components registered in one test do not affect other tests.

This decorator can be applied to a function, method, or a class. If applied to a class, it will search for all methods that start with test_, and apply the decorator to them. This is applied recursively to nested classes as well.

Examples:

Applying to a function:

from django_components.testing import djc_test
 
 @djc_test
 def test_my_component():
diff --git a/dev/release_notes/index.html b/dev/release_notes/index.html
index aa35c7da..67185ae1 100644
--- a/dev/release_notes/index.html
+++ b/dev/release_notes/index.html
@@ -5,7 +5,7 @@
 

Then, to get the URL for the component, use get_component_url():

from django_components import get_component_url
 
 url = get_component_url(MyComponent)
-

This way you don't have to mix your app URLs with component URLs.

Read more on Component views and URLs.

Deprecation¤

Deprecation¤