2016-07-07 87 views
1

我想在我的Django 1.9升級項目django-summernote到0.8.5版本,但使用的設置給定的,我得到這個錯誤:NameError:名字「static_url」沒有定義

File "my_project/settings/base.py", line 314, in <module> 
     static_url('django_summernote/summernote.css'), 
NameError: name 'static_url' is not defined 

我的天堂」之前看過static_url(),它是從哪裏來的,我如何得到這個工作?

回答

2

嘗試查看源碼。您會看到在django_summernote.settings中定義了功能static_url

所以,用它在你的設置模塊你要麼需要將其導入,或自己將其定義爲是這樣的:

def static_url(url): 
    return os.path.join(STATIC_URL, url) 
相關問題