GithubHelp home page GithubHelp logo

Comments (5)

jdwpeterson avatar jdwpeterson commented on June 21, 2024

Hi Mike,

Thanks for getting in touch. Basically all you need to do to register your dashboard is add

registry.register(DashboardClassName)

to to bottom of your dashboards.py file. Where DashboardClassName is the Dashboard you have created.

You need to do this for every dashboard you create. So if you had 2 dashboards, DashboardOne and DashboardTwo, set up you would add:

registry.register(DashboardOne)
registry.register(DashboardTwo)

Your final dashboards.py file should then look something like:

from dashboards.dashboard import Dashboard
from dashboards.component import Text, Chart
from dashboards.registry import registry

from demo.mydashboard.data import DashboardData


class FirstDashboard(Dashboard):
    welcome = Text(value="Welcome to Django Dashboards!")
    animals = Chart(defer=DashboardData.fetch_animals)

    class Meta:
        name = "First Dashboard"


registry.register(FirstDashboard)

I hope this helps but if not, or you have any further questions please get back in touch.

from django-dashboards.

erewh0 avatar erewh0 commented on June 21, 2024

from django-dashboards.

erewh0 avatar erewh0 commented on June 21, 2024

from django-dashboards.

jdwpeterson avatar jdwpeterson commented on June 21, 2024

Hi Mike,

It's hard to tell but looks like maybe your virtual env isn't active or using a different one when running the code.

If you run pip freeze do you see django-dashboards listed?

How are you running the code? Is it command line or via a code editor like VS Code?

You also sent your folder structure but the formatting seems to have messed up. Could you send it again and also show where the manage.py, settings.py and urls.py files live.

from django-dashboards.

erewh0 avatar erewh0 commented on June 21, 2024

from django-dashboards.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.