I m trying to understand what the issue is:
I m试图进口一个单元:
from main.models import Main
from django.contrib import admin
admin.site.register(Main)
然而,当我试图打上行政地点时,我发现一个 d误页:
ImportError at /admin/
cannot import name Main
I noticed that it provides a dump of the **Python Path:**
Python Path: [ /Users/brian/src/SampleApp/src/SampleApp , /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip , /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 , /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin , /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac , /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages , /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python , /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk , /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old , /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload , /Library/Python/2.6/site-packages , /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC , /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode ]
然而,我不理解的是,这一沙捞越之路在哪里?
页: 1 PYTHONPATH,只要未在环境变量中确定,就无回报。
我需要进口一个单元,位于/Users/brian/src/SampleApp/src/SampleApp/main/models.py
增 编