相比django原生的admin后台,bootstrapadmin更加丰满漂亮。对比上图。对比原版】BootstrapAdmin,bootstrap支持的后台界面是不是更吸引客户?pipinstallbootstrap_admin安装成功后,还没有结束,还需要在setting.py中配置才能生效。INSTALLED_APPS=['bootstrap_admin','django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles',]在setting.py中找到INSTALLED_APPS,在第一行添加bootstrap_admin,一定要放在django.contrib.admin中。此时再打开后台,bootstrap应该就生效了。如果你是Windows用户,页面的css效果可能比较乱,说明页面文件没有找到访问地址。这时候还需要在setting.py中找到TEMPLATES。一个配置项。将'DIRS':[os.path.join(BASE_DIR,'templates'),]更改为'DIRS':[os.path.join(BASE_DIR,'templates').replace('\\','/'),]OK,bootstrap的后台就完成了,如果需要其他django教程或者相关问题,也可以关注我公众号提问。
