文章详情页
python - django的views.py引入模块失败
浏览:137日期: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. vue计算属性怎么样与for结合使用2. angular.js - vue/react 渲染内容抖动3. PHP能实现百度网盘的自动化么?4. javascript - 刚开始后边的内容没有加载,伴随鼠标向下滚动,后边内容逐渐加载的效果如何实现?5. android百度地图定位问题6. 微信小程序可以用gulp,webpack吗?7. python - 如何把152753这个字符串转变成时间格式15:27:538. css - 求推荐适用于vue2的框架 像bootstrap这种类型的9. python - @property装饰器会影响到check_password_hash吗?10. android - 关于百度定位的问题
排行榜
