django 工程,使用 virtualenv,创建了一个 app
写了一个 utils.py 在 views 引用了 utils, 我在 pycharm 下面做的开发。 本地都 OK,但是放到开发机器上面,在启动环节就出错。
gunicorn mybook.wsgi 运行时候出错 python3 manger runserver 启动时候出错
错误都是一样,很不解
python3 manage.py runserver
Performing system checks...
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7fb2b2a27400>
File "/home/admin/work/mybook/.env/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/admin/work/mybook/app/urls.py", line 3, in <module>
from scan import views
File "/home/admin/work/mybook/app/views.py", line 5, in <module>
import utils
ModuleNotFoundError: No module named 'utils'
├── README.md
├── mybook
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── manage.py
├── requirements.txt
└── app
├── __init__.py
├── admin.py
├── apps.py
├── editor.py
├── models.py
├── serializers.py
├── sheet.py
├── tests.py
├── uploader.py
├── urls.py
├── utils.py
└── views.py
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.