文章详情页
python - django的views.py引入模块失败
浏览:109日期:2022-06-28 16:29:42
问题描述
from django.shortcuts import renderfrom django.http import HttpResponsefrom django.template import Template, Contextfrom pic_fin import *
报错
No module named ’pic_fin’
pin_fin.py就放在和views.py同一个目录内。之前项目用的python2.7,项目没有报错。现在因为某些原因换成了 python3.5,然后就报错了。
问题解答
回答1:试下换成
from . import pic_fin 或者from .pic_fic import *
相关文章:
1. css3 - 手机网页中用css写1px的描边,为什么需要加一句overflow:hidden才能真正显示1px?2. mysql - 一个表和多个表是多对多的关系,该怎么设计3. mysql新建字段时 timestamp NOT NULL DEFAULT ’0000-00-00 00:00:00’ 报错4. python - type函数问题5. php - 第三方支付平台在很短时间内多次异步通知,订单多次确认收款6. Mysql && Redis 并发问题7. javascript - 百度echarts series数据更新问题8. css3 - css before 中文乱码?9. javascript - node服务端渲染的困惑10. css - 求推荐几款好用的移动端页面布局调试工具呢?
排行榜
