10
10
<img alt =" License: MIT " src =" https://img.shields.io/badge/License-MIT-purple.svg " >
11
11
</a >
12
12
13
- ` django-idom ` allows you to integrate [ IDOM] ( https://github.com/idom-team/idom ) , a
14
- package for building highly interactive user interfaces in pure Python inspired by
15
- [ ReactJS] ( https://reactjs.org/ ) , into Django applications.
13
+ ` django-idom ` allows you to integrate [ IDOM] ( https://github.com/idom-team/idom ) into
14
+ Django applications. IDOM being a package for building responsive user interfaces in
15
+ pure Python which is inspired by [ ReactJS] ( https://reactjs.org/ ) . For more information
16
+ on IDOM refer to [ its documentation] ( https://idom-docs.herokuapp.com ) .
16
17
17
18
** You can try IDOM now in a Jupyter Notebook:**
18
19
<a
@@ -25,8 +26,6 @@ package for building highly interactive user interfaces in pure Python inspired
25
26
src="https://mybinder.org/badge_logo.svg"/>
26
27
</a >
27
28
28
- For more information on IDOM refer to [ its documentation] ( https://idom-docs.herokuapp.com ) .
29
-
30
29
31
30
# Install Django IDOM
32
31
@@ -129,8 +128,15 @@ INSTALLED_APPS = [
129
128
## ` templates/your-template.html `
130
129
131
130
In your templates, you may inject a view of an IDOM component into your templated HTML
132
- by using the ` idom_view ` Jinja tag. You can even pass parameters to your component from
133
- the template via keyword arguments:
131
+ by using the ` idom_view ` Jinja tag. This tag which requires the name of a component to
132
+ render (of the form ` app_name.ComponentName ` ) and keyword arguments you'd like to pass
133
+ it from the template.
134
+
135
+ ``` python
136
+ idom_view app_name.ComponentName param_1= " something" param_2= " something-else"
137
+ ```
138
+
139
+ In context this will look a bit like the following...
134
140
135
141
``` html
136
142
<!-- don't forget your load statements -->
@@ -146,7 +152,8 @@ the template via keyword arguments:
146
152
</html >
147
153
```
148
154
149
- Your view for this template can be defined just like any other
155
+ Your view for this template can be defined just
156
+ [ like any other] ( https://docs.djangoproject.com/en/3.2/intro/tutorial03/#write-views-that-actually-do-something ) .
150
157
151
158
## ` urls.py `
152
159
@@ -156,7 +163,7 @@ To your list of URLs you'll need to include IDOM's static web modules path using
156
163
``` python
157
164
from django.urls import path
158
165
from django_idom import django_idom_web_modules_path
159
- from .views import your_template
166
+ from .views import your_template # define this view like any other HTML template
160
167
161
168
162
169
urlpatterns = [
@@ -173,6 +180,6 @@ You may configure additional options in your `settings.py` file
173
180
# the base URL for all IDOM-releated resources
174
181
IDOM_BASE_URL : str = " _idom/"
175
182
176
- # ignore these apps during component collection
177
- IDOM_IGNORED_DJANGO_APPS : set[str ] = {" some_app" , " some_other_app" }
183
+ # ignore these INSTALLED_APPS during component collection
184
+ IDOM_IGNORE_INSTALLED_APPS : set[str ] = {" some_app" , " some_other_app" }
178
185
```
0 commit comments