📜  Installez django-cruds-adminlte - Python (1)

📅  最后修改于: 2023-12-03 15:15:50.758000             🧑  作者: Mango

Installez django-cruds-adminlte - Python

Introduction

Django-cruds-adminlte is a simple Django application to provide a CRUD (Create, Read, Update, Delete) interface using the AdminLTE template. This allows you to quickly develop an administration interface for your Django project.

Installation

To install django-cruds-adminlte, run the command:

pip install django-cruds-adminlte
Usage
  1. Add 'cruds_adminlte' to your INSTALLED_APPS in settings.py
  2. Define a ModelAdmin class in your app's admin.py file
  3. Register the ModelAdmin class with the cruds_adminlte site registration
  4. Run the Django development server
# settings.py
INSTALLED_APPS = [
    ...
    'cruds_adminlte',
    ...
]

# admin.py
from django.contrib import admin
from cruds_adminlte import cruds as cruds_admin

from .models import MyModel

class MyModelAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'created_at', 'updated_at')
    
cruds_admin.site.register(MyModel, MyModelAdmin)
Features
  • AdminLTE template integration
  • Automatic foreign key field selection with dropdowns
  • Custom views and templates for each CRUD operation
  • Customizable views with built-in method overrides
Conclusion

Django-cruds-adminlte is a useful and user-friendly tool for creating a quick administration interface for your Django project. Its integration with the AdminLTE template makes it easy to customize and add your own personal touch to your project. Try it out today!