mirror of
https://github.com/django-components/django-components.git
synced 2025-09-27 07:59:08 +00:00
refactor: Remove safer_staticfiles, replace STATICFILES_DIRS with COMPONENTS.dirs, support [app]/components
(#652)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
728b4ffad7
commit
e1382d3ccd
34 changed files with 1034 additions and 264 deletions
16
tests/components/staticfiles/staticfiles.py
Normal file
16
tests/components/staticfiles/staticfiles.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
from typing import Any, Dict
|
||||
|
||||
from django_components import Component, register
|
||||
|
||||
|
||||
# Used for testing the staticfiles finder in `test_staticfiles.py`
|
||||
@register("staticfiles_component")
|
||||
class RelativeFileWithPathObjComponent(Component):
|
||||
template_name = "staticfiles.html"
|
||||
|
||||
class Media:
|
||||
js = "staticfiles.js"
|
||||
css = "staticfiles.css"
|
||||
|
||||
def get_context_data(self, variable, *args, **kwargs) -> Dict[str, Any]:
|
||||
return {"variable": variable}
|
Loading…
Add table
Add a link
Reference in a new issue