Skip to main content

Django Admin with Vali theme

Project description

Django Admin Vali

GitHub version Open Source Love

Note

This project is based in django-vali project from cnanyi
https://github.com/cnanyi/django-vali.

Overview

Administrator

  • User who has permission to access the dashboard.
  • Can view all log entries.
  • Can view all dynamics data.

Requirements

  • django >= 2.0
  • python >= 3.0

Routes

Installation

Install using pip...

pip install django-admin-vali

Add 'vali' to your INSTALLED_APPS setting before 'django.contrib.admin'.

INSTALLED_APPS = (
    ...
    'vali',
    'django.contrib.admin',
    ...
)  

If you use Dashboard, include 'vali' to your urls.py setting.

urlpatterns = (
    ...
    path('admin/', include(('vali.urls','vali'), namespace='dashboard')),
    ...
)

In your settings, add VALI_CONFIG.

VALI_CONFIG = {
  'theme': 'default',
  'dashboard': {
      'name': 'Dashboard',
      'url': '/admin/dashboard/',
      'subtitle': 'Dashboard view with all statistics',
      'site_name': 'Dashboard admin',
      'url_image_profile': ''
  },
  'applist': {
      "order": "registry", "group": True
  },
}  

Usage

Note

You can use the model that you want.

In your 'counters.py' add ...

from vali.counters import CounterBase
from .models import Messages

class MessagesCounter(CounterBase):
    title = 'Title goes here'

    def get_value(self, request):
        return Messages.objects.count()  

or

from vali.counters import ModelCounter
from .models import Messages

class MessagesCounter(ModelCounter):
    model = Messages  

alt text

In your 'views.py' add ...

from .counters import MessagesCounter
from vali.views import ValiDashboardBase

class MessagesDashboardView(ValiDashboardBase):
    template_name = 'dashboard.html'

    list_counters = [
        MessagesCounter(),
    ]   

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-admin-vali-0.1.4.tar.gz (476.2 kB view hashes)

Uploaded Source

Built Distribution

django_admin_vali-0.1.4-py3-none-any.whl (504.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page