2013-05-08 127 views
1

我試圖讓使用ChainedForeignKey智能菜單,但到目前爲止,我堅持的ChainedForeignKey進口:AttributeError的:「設置」對象有沒有屬性「ADMIN_MEDIA_PREFIX」

from smart_selects.db_fields import ChainedForeignKey 

我使用的PyDev蝕。 我這裏下載智能選擇包:http://pydoc.net/Python/django-smart-selects/1.0.2/ 並把它添加到我的PYTHONPATH

當我調試,我得到:

Traceback (most recent call last): 
    File "C:\Users\Mr.Machine\Desktop\eclipse\plugins\org.python.pydev_2.7.0.2013032300\pysrc\pydevd.py", line 1397, in <module> 
    debugger.run(setup['file'], None, None) 
    File "C:\Users\Mr.Machine\Desktop\eclipse\plugins\org.python.pydev_2.7.0.2013032300\pysrc\pydevd.py", line 1090, in run 
    pydev_imports.execfile(file, globals, locals) #execute the script 
    File "C:\Users\Mr.Machine\Desktop\Workspace\Medbook\testApp\forms.py", line 4, in <module> 
    from smart_selects.db_fields import ChainedForeignKey 
    File "C:\Users\Mr.Machine\Desktop\django-smart-selects-1.0.2\smart_selects\db_fields.py", line 2, in <module> 
    import form_fields 
    File "C:\Users\Mr.Machine\Desktop\django-smart-selects-1.0.2\smart_selects\form_fields.py", line 1, in <module> 
    from smart_selects.widgets import ChainedSelect 
    File "C:\Users\Mr.Machine\Desktop\django-smart-selects-1.0.2\smart_selects\widgets.py", line 20, in <module> 
    class ChainedSelect(Select): 
    File "C:\Users\Mr.Machine\Desktop\django-smart-selects-1.0.2\smart_selects\widgets.py", line 30, in ChainedSelect 
    class Media: 
    File "C:\Users\Mr.Machine\Desktop\django-smart-selects-1.0.2\smart_selects\widgets.py", line 33, in Media 
    ('js/jquery.min.js', 'js/jquery.init.js')] 
    File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 54, in __getattr__ 
    return getattr(self._wrapped, name) 
AttributeError: 'Settings' object has no attribute 'ADMIN_MEDIA_PREFIX' 

任何幫助表示讚賞

+0

你可以發佈堆棧跟蹤嗎? – karthikr 2013-05-08 17:30:49

+0

文件 「C:\用戶\ Mr.Machine \桌面\工作區\ Medbook \ testApp \ forms.py」,4號線,在 從smart_selects.db_fields導入ChainedForeignKey 導入錯誤:沒有模塊名爲smart_selects.db_fields – ClaudioA 2013-05-08 17:34:35

+0

我使用Eclipse上的pydev,我必須下載一些庫嗎?在settings.py中設置 – ClaudioA 2013-05-08 17:34:52

回答

1

標記爲答案以供將來參考意見:

看起來像ADMIN_MEDIA_PREFIX沒有設置。

設置ADMIN_MEDIA_PREFIX='/static/'或任何其他適當的值爲ADMIN媒體將修復問題

相關問題