mirror of
https://github.com/django-components/django-components.git
synced 2025-08-30 10:47:20 +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
|
@ -7,8 +7,12 @@ from django_components import Component, register, types
|
|||
class Greeting(Component):
|
||||
def get(self, request, *args, **kwargs):
|
||||
slots = {"message": "Hello, world!"}
|
||||
context = {"name": request.GET.get("name", "")}
|
||||
return self.render_to_response(context=context, slots=slots)
|
||||
return self.render_to_response(
|
||||
slots=slots,
|
||||
kwargs={
|
||||
"name": request.GET.get("name", ""),
|
||||
},
|
||||
)
|
||||
|
||||
def get_context_data(self, name, *args, **kwargs) -> Dict[str, Any]:
|
||||
return {"name": name}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue