栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

【Django-CI系统】3.0版本更新时遇到报错-20220506

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

【Django-CI系统】3.0版本更新时遇到报错-20220506

错误1:3.0版本更新时遇到python manage.py collectstatic报错
  • 措施1:python manage.py collectstatic --noinput 需改为python manage.py collectstatic --clear --noinput
    改正后
 #!/bin/bash
python manage.py collectstatic --clear --noinput&&
python manage.py makemigrations&&
python manage.py migrate&&
python manage.py runserver 0.0.0.0:8000
  • 措施2:网上博客说报错跟grappelli有关系,所以我在settings.py中暂时注销掉grappelli。
INSTALLED_APPS = [
    #'grappelli',
    'bootstrap4',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'training',
]
错误2:我有图片字段,需要安装Pillow
  • 措施1:在requirements.txt中加入Pillow==8.3.2。
Django==3.2.7
django-bootstrap4==21.2
django-grappelli==2.15.3
djangorestframework==3.12.4
openpyxl==3.0.9
Pillow==8.3.2
调整错误1和2后,重新生成images并发布到K8S中,可正常运行。
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/861645.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号