I want to do sample application with Tastypie framework.
I added Tastypie to Installed app and modified urls.py
as required, adding from tastypie.api import Api
. But when I open http://localhost:8000/api/v1/?format=json
, I get the following exception:
Exception Value: No module named constants
When I run:
pip install constants
everything looks ok.
Python 2.6 (and try on 2.7)
Django 1.4
Tastypie 0.10.0
the problem is in the resources.py
file for tastypie. It has the following line:
from django.db.models.constants import LOOKUP_SEP
That import will only work on 1.5+. For django < 1.5, it should be:
from django.db.models.sql.constants import LOOKUP_SEP
Upgrading to 1.5 will definitely fix it, but for those who can't, temporarily downgrade tastypie or do that fix yourself.