Django-cotton

Latest version: v1.5.2

Safety actively analyzes 702161 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 10

31.83

---

Block and Extends (Django equivalent)


Django average: 9.38 ms



- Cotton before: 11.38 ms
- Cotton after: 10.56 ms

7.21

---

Include


Django average: 3.12 ms



- Cotton before: 3.16 ms
- Cotton after: 3.04 ms


✅ Cotton performs on-par with Django when used as partial inclusion.

---

⚠️ Possible breaking changes:

- Boolean attributes were previously triggered even when an attribute had an intentional empty srtring:

html
<c-comp myattr />
<c-comp myattr="" />
<c-comp :myattr="i_evaluate_as_empty_string" />

{{ myattr }} <!-- All cases above parse as True


This has now been fixed and only valueless attributes will render as True. Although this was unintentional, some of you may have relied on this defunct behaviour, so be sure to test.


* Support quoted json-like values in {{ attrs }} by mattbha in https://github.com/wrabit/django-cotton/pull/137
* updated render benchmarks by wrabit in https://github.com/wrabit/django-cotton/pull/138
* Support proper boolean attributes by wrabit in https://github.com/wrabit/django-cotton/pull/139
* Tags rewrite + optimisations (up to 28% faster) by wrabit in


**Full Changelog**: https://github.com/wrabit/django-cotton/compare/v0.9.40...v1.0.0

1.5.2

Allow valid json to be passed inside attributes
* Handle attributes containing quoted spaces by wrabit in https://github.com/wrabit/django-cotton/pull/241

Previously, passing a space inside a quoted string inside an attribute value would produce a malformed string due to the way Django understands attributes on a templatetag. Cotton's underlying component templatetag now handles this as expected.

In reference to:
- 240

**Full Changelog**: https://github.com/wrabit/django-cotton/compare/v1.5.1...v1.5.2

1.5.1

`COTTON_BASE_DIR` to set project base location

* Don't rely on existence of BASE_DIR settings variable. by fbinz in https://github.com/wrabit/django-cotton/pull/234

New Contributors
* fbinz made their first contribution in https://github.com/wrabit/django-cotton/pull/234

**Full Changelog**: https://github.com/wrabit/django-cotton/compare/v1.5.0...v1.5.1

1.5.0

Support shorthand alpine.js `x-bind` with `::`
* Support colon escaping - alpinejs bind shortcut support by wrabit in https://github.com/wrabit/django-cotton/pull/227
* More here: https://django-cotton.com/docs/components#alpine-js-support
* Related discussion 180


**Full Changelog**: https://github.com/wrabit/django-cotton/compare/v1.4.0...v1.5.0

1.4.0

Support for top-level project root `templates`

If you are a top-level templates person, you can now place your cotton components in the project root folder. Both of these approaches are supported:

- `[project]/templates/cotton/...` (NEW)
- `[project]/[app]/templates/cotton/...`

**Full Changelog**: https://github.com/wrabit/django-cotton/compare/v1.3.0...v1.4.0

Page 1 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.