Skip to content

Commit 60384af

Browse files
committed
minor README tweaks
1 parent af6601d commit 60384af

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ your_app/
4343
├── asgi.py
4444
├── settings.py
4545
├── urls.py
46-
└── sub_app/
46+
└── example_app/
4747
├── __init__.py
4848
├── idom.py
4949
├── templates/
@@ -120,7 +120,7 @@ urlpatterns = [
120120
]
121121
```
122122

123-
## `sub_app/components.py`
123+
## `example_app/components.py`
124124

125125
This is where, by a convention similar to that of
126126
[`views.py`](https://docs.djangoproject.com/en/3.2/topics/http/views/), you'll define
@@ -136,7 +136,7 @@ def Hello(name): # component names are camelcase by convention
136136
return Header(f"Hello {name}!")
137137
```
138138

139-
## `sub_app/templates/your-template.html`
139+
## `example_app/templates/your-template.html`
140140

141141
In your templates, you may inject a view of an IDOM component into your templated HTML
142142
by using the `idom_view` template tag. This tag which requires the name of a component
@@ -149,7 +149,7 @@ idom_view module_name.ComponentName param_1="something" param_2="something-else"
149149

150150
In context this will look a bit like the following...
151151

152-
```html
152+
```jinja
153153
<!-- don't forget your load statements -->
154154
{% load static %}
155155
{% load idom %}
@@ -158,15 +158,15 @@ In context this will look a bit like the following...
158158
<html>
159159
<body>
160160
...
161-
{% idom_view "your_app.sub_app.components.Hello" name="World" %}
161+
{% idom_view "your_app.example_app.components.Hello" name="World" %}
162162
</body>
163163
</html>
164164
```
165165

166-
Your view for this template can be defined just
167-
[like any other](https://docs.djangoproject.com/en/3.2/intro/tutorial03/#write-views-that-actually-do-something).
166+
## `example_app/views.py`
168167

169-
## `sub_app/views.py`
168+
You can then serve `your-template.html` from a view just
169+
[like any other](https://docs.djangoproject.com/en/3.2/intro/tutorial03/#write-views-that-actually-do-something).
170170

171171
```python
172172
from django.http import HttpResponse
@@ -180,7 +180,7 @@ def your_template(request):
180180
)
181181
```
182182

183-
## `sub_app/urls.py`
183+
## `example_app/urls.py`
184184

185185
Include your replate in the list of urlpatterns
186186

0 commit comments

Comments
 (0)