2016-02-02 102 views
0

使用django-shop教程逐步正確安裝。當我嘗試進行遷移時出現錯誤。請幫我修復它。Django店第一次遷移問題

(shoptutorial) [email protected]:~/Desktop/project/django-shop/example$ ./manage.py migrate 
Traceback (most recent call last): 
    File "./manage.py", line 10, in <module> 
    execute_from_command_line(sys.argv) 
    File "/home/debserv/Desktop/project/shoptutorial/lib/python3.4/site-packages/django/core/ management/__init__.py", line 354, in execute_from_command_line 
    utility.execute() 
    File "/home/debserv/Desktop/project/shoptutorial/lib/python3.4/site-packages/django/core/ management/__init__.py", line 328, in execute 
    django.setup() 
    File "/home/debserv/Desktop/project/shoptutorial/lib/python3.4/site-packages/django/__init__.py", line  18, in setup 
    apps.populate(settings.INSTALLED_APPS) 
    File "/home/debserv/Desktop/project/shoptutorial/lib/python3.4/site-packages/django/apps/registry.py",  line 108, in populate 
    app_config.import_models(all_models) 
    File "/home/debserv/Desktop/project/shoptutorial/lib/python3.4/site-packages/django/apps/config.py",  line 198, in import_models 
    self.models_module = import_module(models_module_name) 
    File "/home/debserv/Desktop/project/shoptutorial/lib/python3.4/importlib/__init__.py", line 109, in  import_module 
    return _bootstrap._gcd_import(name[level:], package, level) 
    File "<frozen importlib._bootstrap>", line 2254, in _gcd_import 
    File "<frozen importlib._bootstrap>", line 2237, in _find_and_load 
    File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked 
    File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked 
    File "<frozen importlib._bootstrap>", line 1129, in _exec 
    File "<frozen importlib._bootstrap>", line 1471, in exec_module 
    File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed 
    File "/home/debserv/Desktop/project/django-shop/example/myshop/models/__init__.py", line 7, in <module> 
    from shop.models.defaults.cart import Cart 
    File "/home/debserv/Desktop/project/django-shop/shop/models/defaults/cart.py", line 5, in <module> 
    from shop.models.cart import BaseCart 
    File "/home/debserv/Desktop/project/django-shop/shop/models/cart.py", line 12, in <module> 
    from shop.money import Money 
    File "/home/debserv/Desktop/project/django-shop/shop/money/__init__.py", line 2, in <module> 
    from money_maker import MoneyMaker, AbstractMoney 
ImportError: No module named 'money_maker' 
+2

是money_maker在你的應用程序文件?如果是,請發佈你的目錄結構。如果沒有請參考money_maker來自 –

+0

,它來自/project/django-shop/shop/money/money_maker.py –

回答

0

我想在你的django-shop/shop/money/__init__.py 而不是

from money_maker import MoneyMaker, AbstractMoney 

你應該:

import .money_maker import MoneyMaker, AbstractMoney 

import shop.money.money_maker import MoneyMaker, AbstractMoney 
+0

它有幫助。非常感謝。 –