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
Remove deprecated view-based asset serving and related code (#171)
* Remove deprecated view-based asset serving and related code
* update changelog
* remove newline
* remove prints
* make mypy happy
* add views to coverage ignore
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,10 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/
22
22
23
23
- Added the `{% bird:var %}` templatetag for managing local context variables within components, including support for appending, overwriting, and resetting values. Variables are scoped to components and automatically are cleaned up when the component finishes rendering, with optional explicit cleanup via `{% endbird:var %}`.
24
24
25
+
### Removed
26
+
27
+
- Removed the deprecated asset serving view (`asset_view`) and its URL configuration. Use `BirdAssetFinder` with Django's staticfiles app instead.
This will collect all component assets into your static files directory, allowing you to serve them via your web server, [WhiteNoise](https://whitenoise.readthedocs.io), or a CDN.
136
-
137
-
### Deprecated View-Based Serving
138
-
139
-
```{warning}
140
-
**Warning:** The built-in asset serving view is deprecated and will be removed in a future release. Please switch to using the custom staticfiles finder and serve assets through Django's static files system.
141
-
```
142
-
143
-
If you still need to use the view-based asset serving during the transition, you can enable it by adding django-bird's URLs to your project's URL configuration:
144
-
145
-
```{code-block} python
146
-
:caption: urls.py
147
-
148
-
from django.conf import settings
149
-
from django.urls import include
150
-
from django.urls import path
151
-
152
-
153
-
if settings.DEBUG:
154
-
urlpatterns = [
155
-
path("__bird__/", include("django_bird.urls")),
156
-
]
157
-
```
158
-
159
-
This will make component assets available at `/__bird__/assets/<component_name>/<asset_filename>` when `DEBUG` is `True`.
0 commit comments