2011-09-18 92 views
1

我想在Ubuntu上安裝Django。我正在通過以下安裝教程:http://jeffbaier.com/articles/installing-django-on-an-ubuntu-linux-server/初學者django設置:無法導入設置'myproject.settings'

當我嘗試執行'syncdb'步驟時出現錯誤。這看起來像是一個環境問題。我該如何解決?

[email protected]:~/django_projects/myproject$ django-admin.py syncdb 
Traceback (most recent call last): 
    File "/usr/local/bin/django-admin.py", line 5, in <module> 
    management.execute_from_command_line() 
    File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 433, in execute_from_command_line 
    utility.execute() 
    ... 
    File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 92, in __init__ 
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e)) 
ImportError: Could not import settings 'myproject.settings' (Is it on sys.path?): No module named myproject.settings 
[email protected]:~/django_projects/myproject$ 

回答

0

不,這是該教程的問題。您應該運行manage.py syncdb

+0

太容易了......謝謝! – codingJoe

0

django-admin.py syncdb --settings=myproject.settings 

./manage.py是說,每個新的Django項目設置與配置的路徑,具體項目settings.py文件薄薄的包裝。

相關問題