egidra
egidra

Reputation: 9087

Tastypie URLs not configured properly

I get the following error when I try to access http://localhost:8000/api/goal/?format=json:

ImproperlyConfigured at /api/goal/
The included urlconf <property object at 0x262bb50> doesn't have any patterns in it

Here is what I have added to my urls.py:

goal_resource = GoalResource

...

    url(r'^api/', include(goal_resource.urls)),

Here is my api.py:

class GoalResource(ModelResource):
  class Meta:
    queryset = Goal.objects.all()
    resource_name = 'goal'

Any idea what could be going wrong?

Upvotes: 2

Views: 477

Answers (1)

nickzam
nickzam

Reputation: 813

You need to call GoalResource, not just bind it's memory address to variable. So change

goal_resource = GoalResource

to

goal_resource = GoalResource()

Upvotes: 7

Related Questions