Skip to content

Commit

Permalink
Merge pull request #235 from wrabit/pr-234-tweaks
Browse files Browse the repository at this point in the history
Pr 234 tweaks
  • Loading branch information
wrabit authored Dec 6, 2024
2 parents b3ee2c6 + 2e37a8f commit 4107d13
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ The directory where your components are stored.
`COTTON_BASE_DIR` (default: None)
The directory that contains your project-level "templates" directory.
If you use a project-level templates folder then you can set the path here. This is not needed if your project already has a `BASE_DIR` variable.
`COTTON_SNAKE_CASED_NAMES` (default: True)
Expand All @@ -486,12 +486,7 @@ Whether to search for component filenames in snake_case. If set to False, you ca
## Caching
Cotton is optimal when used with Django's cached.Loader. If you use <a href="https://django-cotton.com/docs/quickstart">automatic configuration</a> then the cached loader will be automatically applied. This feature has room for improvement, some desirables are:
- Integration with a cache backend to survive runtime restarts / deployments.
- Cache warming
For full docs and demos, checkout <a href="https://django-cotton.com" target="_blank">django-cotton.com</a>
Cotton is optimal when used with Django's cached.Loader. If you use <a href="https://django-cotton.com/docs/quickstart">automatic configuration</a> then the cached loader will be automatically applied.
<hr>
Expand Down Expand Up @@ -531,3 +526,7 @@ For full docs and demos, checkout <a href="https://django-cotton.com" target="_b
**Notes:**
- Some features here can be resolved with 3rd party plugins, for example for expressions, you can use something like `django-expr` package. So the list focuses on a comparison of core feature of that library.
<hr>
For full docs and demos, checkout <a href="https://django-cotton.com" target="_blank">django-cotton.com</a>
2 changes: 1 addition & 1 deletion dev/example_project/templates/cotton/project_root.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
I'm from project roo templates!
I'm from project root templates!
2 changes: 1 addition & 1 deletion django_cotton/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,5 @@ def test_multiple_app_subdirectory_access(self):
rendered = get_rendered(html)

self.assertTrue("I'm from app templates!" in rendered)
self.assertTrue("I'm from project roo templates!" in rendered)
self.assertTrue("I'm from project root templates!" in rendered)
self.assertTrue("i'm sub in project root" in rendered)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1>Configuration</h1>
<div>str (default: None)</div>
</div>
<div>
The base directory where - in addition to the app folders - cotton will search for the "templates" directory (see above).
The base directory where - in addition to the app folders - cotton will search for the "templates" directory (see above).
If not set, the `BASE_DIR` generated by `django-admin startproject` is used as a fallback, if it exists.
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs_project/docs_project/templates/quickstart.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h2>Templates location</h2>
<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>
<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>
(where the <code>[project]</code> depends on the `BASE_DIR` or `COTTON_BASE_DIR` settings)
(<code>[project]</code> location is provided by `BASE_DIR` if present or you may set it with `COTTON_BASE_DIR`)
</li>
</c-ul>

Expand Down

0 comments on commit 4107d13

Please sign in to comment.