Django Admin with Vali theme
Project description
Django Admin Vali
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
-
Site:
- url:
/admin
- Page with administrator access.
- url:
/admin/dashboard
- Page with dashboard access.
Extra
This project allows you to use i18n in urls https://github.com/cnanyi/django-vali.
- url:
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
In your 'counters.py'
add ...
from vali.counters import CounterBase
from .models import MyModel
class MyModelCounter(CounterBase):
title = 'Title goes here'
def get_value(self, request):
return MyModel.objects.count()
In your 'views.py'
add ...
from .counters import MyModelCounter
from vali.views import ValiDashboardBase
class MyModelDashboardView(ValiDashboardBase):
template_name = 'dashboard.html'
list_counters = [
MyModelCounter(),
]
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
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.2.tar.gz
(470.9 kB
view hashes)
Built Distribution
Close
Hashes for django_admin_vali-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60e6509529d5f1371421edee0c7ae7c9ce7dd186e0272ea5f7902249bbd7614e |
|
MD5 | 7072fa75627ea81988f98af0d5daf79e |
|
BLAKE2b-256 | c5649a28115031aadab3eecd8bafcbc5498c0ed7825f1fa66062f5d1617429d4 |