Improve structure of sampleproject.

This commit is contained in:
Emil Stenström 2022-07-18 09:13:36 +02:00
parent 18ee5ad3b0
commit c0ed45b920
7 changed files with 14 additions and 8 deletions

View file

@ -3,8 +3,9 @@ from django_components import component
@component.register("calendar")
class Calendar(component.Component):
# Note that Django will look for templates inside `[your app]/components` dir
# To customize which template to use based on context override get_template_name instead
# Note that Django will look for templates inside `[your apps]/components` dir and
# `[project root]/components` dir. To customize which template to use based on context
# you can override def get_template_name() instead of specifying the below variable.
template_name = "calendar/calendar.html"
# This component takes one parameter, a date string to show in the template
@ -14,5 +15,5 @@ class Calendar(component.Component):
}
class Media:
css = "calendarapp/components/calendar/calendar.css"
js = "calendarapp/components/calendar/calendar.js"
css = "calendar/calendar.css"
js = "calendar/calendar.js"