0
我加選擇2到的urls.py:爲什麼我在404上查詢django admin中的select2?
url(r'^select2/', include('django_select2.urls')),
而且使小部件管理:
class WordSelect2MultipleWidgetForm(forms.ModelForm):
class Meta:
model = SeoTextCategory
fields = (
'words',
)
widgets = {
'words': ModelSelect2MultipleWidget(
model=Word_Replace,
search_fields=['word__icontains']),
}
class SeoTextCategoryAdmin(ModelAdmin):
form = WordSelect2MultipleWidgetForm
在我的管理它看起來很棒,但在嘗試輸入一些當我得到404:
[14/Nov/2016 11:21:47] "GET /select2/fields/auto.json?term=%D0%BF%D1%80&field_id=MTQwNDI5MDk2NTQ5OTYw%3A1c6BaH%3AaaeoV6gvQ0QtjH5FC1q3VDwwFcY HTTP/1.1" 404 932
我需要在views.py中做些什麼嗎?