darklow / django-suit

Modern theme for Django admin interface
http://djangosuit.com/
Other
2.31k stars 701 forks source link

Dashboard ideas - share & discuss #49

Open darklow opened 11 years ago

darklow commented 11 years ago

Please share you ideas on how should we make alternative dashboard for Django Suit (besides original apps list). What options should be there, how you should define what's in dashboard. What dashboard widgets/blocks should be there available by default. Because needs can differ so much. Thanks.

maartendraijer commented 11 years ago

My vote would be for Google Analytics integration (just like https://github.com/yawd/yawd-admin). :smiley:

skndn60 commented 11 years ago

I have made a custom dashboard by overriding index.html and implementing a couple of custom tags. This works pretty well and effectively gets rid of the default (and now useless due to the great menu of DS) version of index.html.

It all depends what you intend to do with your admin. For me the admin is a tool for the end user and I have fairly far reaching customisations in my admin templates.

I have attached a screen shot of my dashboard so far. I have played around with Google Charts (https://google-developers.appspot.com/chart/interactive/docs/gallery) which looks really neat. Widgets that encapsulate the various charting options would be awesome; I think there's already a Pyhton wrapper for them but I haven't tried that out yet...

Screen Shot 2013-03-22 at 11 09 36

darklow commented 11 years ago

@skndn60 got a valid point and proves that django templating is most powerful tool already, you can put in your templates anything you want - wether it is charting, stats or simple list. Use templatetags and you got your reusable widget system already.

I think what Django Suit needs is to provide alternative Home url, where you can put your own dashboard, which will affect login redirect, home link in location bar and so on. Also related to #43

jonashaag commented 11 years ago

How about designing this around some sort of plugin architecture.

class MyDashboard(Dashboard):
    columns = [
        # col 1
        [
            ("Server stats", ['suit_stats.requests_per_seconds', 'suit_stats.cpu_usage']),
            ("Frequently used", ['auth.users', 'polls']),
        ],
        # col 2
        [
            ("Registrations", ['total_users', 'recently_registered_users']),
            ...
        ],
        ...
    ]

    def total_users(self):
        return User.objects.count()
    total_users.short_description = "Total user count"

    def recently_registered_users(self):
        users = User.objects.all()[:10]
        return render_to_response('mydashboard/recent_registrations.html', {'users': users})

Items can be names of either

Just an idea.

grillermo commented 11 years ago

I would love a way to add buttons to the change view of my models. From the admin.py of the app like the admin actions, that would be super useful.

If you want to integrate analytics or stats, i wouldnt go with python generated one, i've tried them all, in my experience is way better to generate graphs on frontend space, htm, css, javascript, those tools are closer to the problem, my recommendation, jqplot. But a python api for their javascript api seems a bad idea.

skndn60 commented 11 years ago

Hmm... you need something to aggregate/slice/dice your server side data and then display them with a graphing library frontend. I prefer Python for that anytime. Obviously the actual plotting is frontend. Google Chart and the Python API aim to do just that... You just push your chart data to Google and they return a high quality chart which you insert into your template (either a url or an image). I had a quick look at it and added a Geo chart (like the one you see in Google Analytics) with one trivial custom template tag. Added bonus: no libraries and version to juggle, no hosting. I like it.

gamesbook commented 11 years ago

A new app, Graphos (https://github.com/agiliq/django-graphos) might be a simple and quick way to add charts & plots to the dashboard (not that there is anything wrong with Google! but if your system is hosted inside a company, with no external calls allowed, then this type of approach might be better).

skndn60 commented 11 years ago

Looks promising. They support various plotting APIs. Thanks for sharing.

Zowie commented 8 years ago

@darklow Wondering if this is something that has evolved in the past 2 years or has just been forgotten.

SalahAdDin commented 8 years ago

:+1:

pawamoy commented 8 years ago

Hi, here is what I got as dashboard PoC with Suit and Highcharts:

capture du 2016-04-05 13-08-34

I followed instructions found in https://github.com/darklow/django-suit/issues/409. However it seems I can't use columns as in Bootstrap, with col-md and stuff. So I used the class suit-column, and I noticed that each new div with this class is stacked next to the previous one. It is already great but not precise enough :baby_chick: As you can see on the above screenshot, the first row with two columns is not expanding to the maximum width. And if I add a third column, the three are not thin enough to fit in the maximum width and the last one appears on a second row. Besides some weird resizing happens when resizing the window (but it might just be Highcharts):

capture du 2016-04-05 13-08-16

Question: what would be the best way to work with columns with what Suit is already providing? Conclusion: a dashboard should be customizable with columns :hamster:

SalahAdDin commented 8 years ago

@Pawamoy , man, will be great that you make a tutorial for use charts in django-suit.

pawamoy commented 8 years ago

@SalahAdDin I wrote a blog post (my first one, always wanted to use github pages) to explain how I did this ;)

pawamoy commented 8 years ago

Actually I created a django-app: django-suit-dashboard, go take a look if you are interested.

It lets you arrange widgets with rows and columns in your admin pages. The templates can already render highcharts' charts but you will have to write them at hand (in python), dump them in json and pass them as context (in widgets). I will write a small example in the docs when I have the time.

The app is only a few days old, so be indulgent!!