|
| 1 | +# Welcome to django-adminlte-ui |
| 2 | + |
| 3 | +[](https://pypi.python.org/pypi/django-adminlte-ui) |
| 4 | +[](https://pypi.python.org/pypi/django-adminlte-ui) |
| 5 | +[](https://travis-ci.org/wuyue92tree/django-adminlte-ui) |
| 6 | + |
| 7 | +django-adminlte is a django admin theme base on adminlte |
| 8 | + |
| 9 | +adminlte version: 2.3.6 |
| 10 | + |
| 11 | + |
| 12 | +## Helper |
| 13 | + |
| 14 | +- if you have good ideas, just contact me. |
| 15 | +- if you find some bug, just add an issue. |
| 16 | +- if you think this project is good, just star and fork, make it better 🍉. |
| 17 | + |
| 18 | + |
| 19 | +## Install |
| 20 | + |
| 21 | +``` |
| 22 | +pip install django-adminlte-ui |
| 23 | +``` |
| 24 | + |
| 25 | +## Setup |
| 26 | + |
| 27 | +``` |
| 28 | +# settings.py |
| 29 | +
|
| 30 | +INSTALLED_APPS = [ |
| 31 | + 'adminlteui', |
| 32 | + 'django.contrib.admin', |
| 33 | + 'django.contrib.auth', |
| 34 | + 'django.contrib.sites', |
| 35 | + 'django.contrib.sitemaps', |
| 36 | + 'django.contrib.contenttypes', |
| 37 | + 'django.contrib.sessions', |
| 38 | + 'django.contrib.messages', |
| 39 | + 'django.contrib.staticfiles', |
| 40 | + ... |
| 41 | +] |
| 42 | +``` |
| 43 | + |
| 44 | +## Init models |
| 45 | +``` |
| 46 | +python manage.py migrate django_admin_settings |
| 47 | +``` |
| 48 | + |
| 49 | +## Guides |
| 50 | + |
| 51 | +### General Option |
| 52 | + |
| 53 | +dynamic setup your site base on table `django_admin_settings_options`. |
| 54 | + |
| 55 | +support options: |
| 56 | + |
| 57 | +- Site Title |
| 58 | +- Site Header |
| 59 | +- Site Logo |
| 60 | +- Welcome Sign |
| 61 | + |
| 62 | +### Options |
| 63 | + |
| 64 | +this options in your db, named `django_admin_settings_options`, after do migrate. |
| 65 | + |
| 66 | +you can also add your custom option into this table, and use it by templatetags |
| 67 | + `adminlte_options` with function `get_adminlte_option`. |
| 68 | + |
| 69 | +options table has a valid field to control your option work or not. |
| 70 | + |
| 71 | + |
| 72 | +example: |
| 73 | + |
| 74 | +``` |
| 75 | +# adminlte/general_option.html |
| 76 | +
|
| 77 | +{% load adminlte_options %} |
| 78 | +
|
| 79 | +# here my option_name is site_title, you can custom yourself. |
| 80 | +{% get_adminlte_option 'site_title' as adminlte_site_title %} |
| 81 | +{% if adminlte_site_title.valid %} |
| 82 | +{{ adminlte_site_title.site_title }} |
| 83 | +{% else %} |
| 84 | +{{ site_title|default:_('Django site admin') }} |
| 85 | +{% endif %} |
| 86 | +
|
| 87 | +``` |
| 88 | + |
| 89 | +before custom option, you should known what adminlte has used. |
| 90 | + |
| 91 | +- site_title |
| 92 | +- site_header |
| 93 | +- site_logo |
| 94 | +- welcome_sign |
| 95 | + |
| 96 | + |
| 97 | +### Menu |
| 98 | + |
| 99 | +coming soon... |
0 commit comments