0

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 :

  • dashing/dashboard.html
  • dashing/css/global.css

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',
)```

1 Answer 1

0

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

8
  • The folder of my app is "django_dashing", but I have already this in INSTALLED_APPS INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_dashing', 'dashing', )
    – Eva
    Commented Jun 13, 2019 at 14:26
  • Yes so add the 'django_dashing', line before 'django.contrib.admin', so that the default templates are overridden Commented Jun 13, 2019 at 14:30
  • So, I added 'django_dashing' before 'django.contrib.admin' but it don't work :(
    – Eva
    Commented Jun 14, 2019 at 6:57
  • And I emptied the cache too
    – Eva
    Commented Jun 14, 2019 at 6:59
  • can you also share your views, urls file contents ? Commented Jun 14, 2019 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.