mirror of
https://github.com/django-components/django-components.git
synced 2025-08-03 13:58:16 +00:00
Improve structure of sampleproject.
This commit is contained in:
parent
18ee5ad3b0
commit
c0ed45b920
7 changed files with 14 additions and 8 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue