Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> Python

Triển khai django-material trong dự án Django


django-material áp dụng Material Design cho form widget tự động, không cần CDN.

Cách dùng

  1. pip install django-material

  2. Thêm 'material' vào INSTALLED_APPS.

  3. Template include CSS/JS:

    {% include 'material/includes/material_css.html' %}
    {% include 'material/includes/material_js.html' %}
  4. Render form bình thường: {{ form }} → input/select có style Material.

Kết quả

Form đẹp, hiện đại, responsive ngay lập tức.