,我發現了以下錯誤沒有模式:名爲「MYAPP」即使我已經添加了它在settings.py
ImportError at/
No module named midi_app
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.4.1
Exception Type: ImportError
Exception Value: No module named midi_app
Exception Location: /Users/home/virtualenv/venv/lib/python2.7/site-packages/django/utils/importlib.py in import_module, line 35
Python Executable: /Users/home/virtualenv/venv/bin/python
我已經加入我的應用「midi_app」設定的[INSTALLED_APPS
部分。 PY。我不確定爲什麼我看到這個錯誤。 virtualenv可以與它有什麼關係?
謝謝。
更新:我已經添加儘可能多的目錄,因爲我能想到,我仍然看到這個錯誤。請參閱下面的路徑。請協助,我真的很沮喪。
'/Users/home/virtualenv/venv/lib/python27.zip',
'/Users/home/virtualenv/venv/lib/python2.7',
'/Users/home/virtualenv/venv/lib/python2.7/plat-darwin',
'/Users/home/virtualenv/venv/lib/python2.7/plat-mac',
'/Users/home/virtualenv/venv/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/home/virtualenv/venv/lib/python2.7/lib-tk',
'/Users/home/virtualenv/venv/lib/python2.7/lib-old',
'/Users/home/virtualenv/venv/lib/python2.7/lib-dynload',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/home/virtualenv/venv/lib/python2.7/site-packages',
'/Users/home/Desktop/Web Development/Django-1.4',
'/Users/home/virtualenv/venv',
'/Users/home/Desktop/Web Development/Aptana Studio 3.0',
'/Users/home/virtualenv/venv/bin',
'/Users/home/Desktop/Web Development',
'/Users/home/virtualenv',
'/Users/home/virtualenv/venv/lib/python2.7/site-packages/PIL',
'/Users/home/virtualenv/venv/lib/python27.zip',
'/Users/home/virtualenv/venv/lib/python2.7/plat-darwin',
'/Users/home/virtualenv/venv/lib/python2.7/plat-mac',
'/Users/home/virtualenv/venv/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/home/virtualenv/venv/lib/python2.7/lib-tk',
'/Users/home/virtualenv/venv/lib/python2.7/lib-old'
顯示您的項目的目錄結構。如果您的應用程序不在項目級別,您可能需要添加項目名稱(即myproject.midi_app)。 – dannyroa