Eva
Eva

Reputation: 23

I want to custom CSS of my django-dashing, all widgets

I want to add css in django-dashing for override all widget.

I tried follow this doc https://django-dashing.readthedocs.io/en/latest/getting-started.html#template-file

But I don't understand : "Also make sure the app which hosts the dashing/dashboard.html template is listed before dashing in INSTALLED_APPS, since you are overriding the default template."
=> I don't have a "hosts", i have just css file...

I create files :

And I fill dashboard.html :

{% extends 'dashing/base.html' %}
{% load staticfiles %}

{% block stylesheets %}
<link rel="stylesheet" href="{% static 'css/global.css' %}">
{% endblock %}

EDIT And I add my "host" in 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',
)```

Upvotes: 0

Views: 160

Answers (1)

Amartya Gaur
Amartya Gaur

Reputation: 705

You need to create an app first to use django which would contain the models(dataset structure) views ( how you want to render any html template or what context you need to pass) and other files as per your requirements.

The templates, views, urls and models would be a part of the app which you would create after creating the django project now to add that app to django you need to modify settings.py of the project and add (if your app's name is blog) :

'blog.apps.BlogConfig'

That you need to add in INSTALLED_APPS section of setting.py before every other app so that django while searching for templates renders your templates first instead of the default ones

Upvotes: 0

Related Questions