Error Using django-tables2 - Expected table or queryset, not 'str'

后端 未结 4 1381
感动是毒
感动是毒 2021-02-05 19:13

I am trying to create some tables for my application using django-tables2 and running into some difficulties. I am using Python 2.7, and Django 1.7. I am following the tutorial,

4条回答
  •  悲哀的现实
    2021-02-05 19:43

    I encountered that problem, too. The first thing you should do is to check your updates:

    sudo pip install django-tables2 --upgrade
    sudo pip install django-tables2-reports --upgrade
    

    Upgrades didn't work mine problem too.
    If you have already upgraded version of these. You should check your implementation. If you are using Class Based View and you are pretty sure that you implement the view,template,table. You probably forget the urls:

    /* I give the example with respect to other post*/
    urls.py  /*Same dic with table.py,models..etc*/
    
    from .views import SomeTableView   
    urlpatterns = patterns('',
                       url(r"^$", SomeTableView.as_view(), name="index"),
    
                       
                       )
    

    If it is not index of your website you have to probably change the r"^$" and name="index"

提交回复
热议问题