【发布时间】:2012-08-02 20:39:55
【问题描述】:
我正在关注该教程 http://thecodachi.blogspot.com/2012/03/django-tastypie-with-android-client.html 和 https://github.com/Mbosco/tastypie-api-example
我在教程中做了所有事情,但是当我运行“localhost:8000/api/recipes/?format=json”时出现错误“没有名为 recipe_resource.urls 的模块”
你能帮我解决一下吗?
【问题讨论】:
-
你没有名为
recipe_resource.py的文件,是吗? -
不,它被称为 queryset = Recipe.objects.all() 并且指的是Recipe
-
这不是他要问的。你真的有一个名为“recipe_resource.py”的文件吗?
-
尝试将
url(r'^api/', include('recipe_resource.urls')),更改为:url(r'^api/', include(recipe_resource.urls)),(不带简单引号) -
谢谢,它有效。还有一个问题,如果我使用http post从android发布食谱(名称和内容),我应该使用什么方法来记录从android发送的数据到django数据库?