Home  >  Q&A  >  body text

python - django's views.py fails to introduce module

from django.shortcuts import render
from django.http import HttpResponse
from django.template import Template, Context
from pic_fin import *

Error reporting

No module named 'pic_fin'

pin_fin.py is placed in the same directory as views.py.
The previous project used python2.7, and the project did not report any errors. Now for some reasons, I changed it to python3.5, and then I got an error.

女神的闺蜜爱上我女神的闺蜜爱上我2686 days ago794

reply all(1)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-06-12 09:30:03

    Try changing to

    from . import pic_fin 或者
    from .pic_fic import *

    reply
    0
  • Cancelreply