I'm using the Django-Dashing framework ( https://github.com/talpor/django-dashing ), and I can't figure out where to place my HTML file for the custom widget that I am using.
I have the following code in my dashboard.html
file, which is being loaded properly.
{% extends 'dashing/base.html' %}
{% load staticfiles %}
{% block stylesheets %}
<link rel="stylesheet" href="{% static '../../static/widgets/timetables/timetables.css' %}">
<!--<link rel="stylesheet" href="{% static '../../../../static/css/analytics/widgets/timetables.css' %}">-->
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="{% static '../../static/widgets/timetables/timetables.js' %}"></script>
<!--<script type="text/javascript" src="{% static '../../../../static/js/analytics/widgets/timetables.js' %}"></script>-->
{% endblock %}
{% block config_file %}
<script type="text/javascript" src="{% static '../../static/dashing-config.js' %}"></script>
<!--<script type="text/javascript" src="{% static '../../../../static/js/analytics/dashing-config.js' %}"></script>-->
{% endblock %}
I also believe I properly defined my TimetablesWidget
class properly in widgets.py
, and its corresponding JavaScript class name Timetables
properly, as all of the data is being correctly fetched when the widget renders.
I did a console.log
statement to make sure that the data was being fetched properly, and it indeed is. However, it is not rendering correctly in the div
on the screen, which makes me think that my timetables.html
file is not actually being loaded.
Based on where I defined my other paths, could someone let me know where I am supposed to put my HTML file, or perhaps correct me if I am doing something else wrong?
Thanks in advance!
You can static file feature of Django
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.