[英]I want to custom CSS of my django-dashing, all widgets
我想在django-dashing中添加css以覆蓋所有小部件。
我試過按照這個文檔https://django-dashing.readthedocs.io/en/latest/getting-started.html#template-file
但我不明白:“還要確保在使用INSTALLED_APPS划線之前列出了承載dashing / dashboard.html模板的應用程序,因為您要覆蓋默認模板。” =>我沒有“主機”,我只有css文件...
我創建文件:
我填寫dashboard.html:
{% extends 'dashing/base.html' %}
{% load staticfiles %}
{% block stylesheets %}
<link rel="stylesheet" href="{% static 'css/global.css' %}">
{% endblock %}
編輯我在INSTALLED_APPS(settings.py)中添加我的“主機”
INSTALLED_APPS = (
'django_dashing', # here
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'dashing',
)```
您需要首先創建一個應用程序來使用django,它將包含模型(數據集結構)視圖(您希望如何呈現任何html模板或需要傳遞的上下文)和其他文件,以滿足您的要求。
模板,視圖,網址和模型將成為應用程序的一部分,您將在創建django項目后立即將該應用程序添加到django,您需要修改項目的settings.py並添加(如果您的應用程序的名稱是博客) ):
'blog.apps.BlogConfig'
您需要在每個其他應用程序之前添加setting.py的INSTALLED_APPS部分,以便django在搜索模板時首先呈現模板而不是默認模板
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.