You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>This will automatically handle the settings.py adding the required loader and templatetags.</p>
30
+
<p>This will attempt to automatically handle the settings.py by adding the required loader and templatetags.</p>
30
31
31
-
<h3>Customised configuration</h3>
32
+
<h3>For custom configuration</h3>
32
33
33
34
<p>If your project requires any non-default loaders or you do not wish Cotton to manage your settings, you should instead provide `django_cotton.apps.SimpleAppConfig` in your INSTALLED_APPS:</p>
<p>Cotton supports 2 common approaches regarding the location of the <code>templates</code> directory:</p>
81
+
82
+
<c-ul>
83
+
<li><strong>App level</strong> - You can place your cotton folder in any of your installed app folders, like: <div><code>[project]/[app]/templates/cotton/row.html</code></div></li>
84
+
<li><strong>Project root</strong> - You can place your cotton folder in a project level templates directory, like: <div><code>[project]/templates/cotton/row.html</code></div></li>
85
+
</c-ul>
86
+
87
+
<p>Any style will allow you to include your component the same way: <code>{{ '<c-row/>'|force_escape }}</code></p>
75
88
76
89
<c-hrid="include-a-component" />
77
90
@@ -111,7 +124,8 @@ <h2 id="usage">Usage</h2>
111
124
112
125
<h3id="basics">Basics</h3>
113
126
<c-ul>
114
-
<li>Cotton components should be placed in the <c-highlight>templates/cotton</c-highlight> folder (unless you have set COTTON_DIR).</li>
127
+
<li>Cotton components should be placed in the <c-highlight>templates/cotton</c-highlight> folder ('cotton' directory is <ahref="{% url 'configuration' %}">configurable</a> using COTTON_DIR).</li>
128
+
<li>The <code>templates</code> folder can be located in either an app-level or top-level project root folder.</li>
0 commit comments