未找到 ext-json 类型的发射器
我在运行 django 时遇到此错误“未找到 ext-json 类型的发射器”... 我对自己的情况一无所知。
我刚刚遵循了这个教程,这个例子很好。 http://weblog.mattdorn。 com/content/restful-web-apps-with-django-piston-and-ext-js/
我已经遵循了制作 handlers.py、emmiters.py 和其他步骤...
这是我的 url.py
from django.conf.urls.defaults import *
from piston.resource import Resource
from phonebook.api.handlers import PhonebookHandler
phonebook_handler = Resource(PhonebookHandler)
urlpatterns=patterns('',
url(r'^phonebooks/(?P<id>\d+)/$',phonebook_handler, {'emitter_format': 'ext-json'}),
url(r'^phonebooks$',phonebook_handler, {'emitter_format': 'ext-json'}),
)
我的emitters.py 和 handlers.py 与教程相同,...不同的是我的 models.py
from django.db import models
from django.contrib.auth.models import User
CHOICES = (
(u'M', u'Male'),
(u'F', u'Female'),
)
class Phonebook(models.Model):
fullname = models.CharField(max_length=50,null=True)
address = models.CharField(max_length=100,null=True)
age = models.IntegerField(max_length=2,null=True)
gender = models.CharField(max_length=1, choices=CHOICES)
phonenumber = models.CharField(max_length=15,null=True)
def __unicode__(self):
return self.fullname
是否有关于 ext-json 的安装?
I have this error "No emitters found for type ext-json" in running my django...
i dont have any idea about my situation.
i just followed this tutorial and the example is good.
http://weblog.mattdorn.com/content/restful-web-apps-with-django-piston-and-ext-js/
i have followed on making handlers.py, emmiters.py and the others step...
this my url.py
from django.conf.urls.defaults import *
from piston.resource import Resource
from phonebook.api.handlers import PhonebookHandler
phonebook_handler = Resource(PhonebookHandler)
urlpatterns=patterns('',
url(r'^phonebooks/(?P<id>\d+)/
my emitters.py and handlers.py is same to the tutorial,... the different is my models.py
from django.db import models
from django.contrib.auth.models import User
CHOICES = (
(u'M', u'Male'),
(u'F', u'Female'),
)
class Phonebook(models.Model):
fullname = models.CharField(max_length=50,null=True)
address = models.CharField(max_length=100,null=True)
age = models.IntegerField(max_length=2,null=True)
gender = models.CharField(max_length=1, choices=CHOICES)
phonenumber = models.CharField(max_length=15,null=True)
def __unicode__(self):
return self.fullname
is there are any installation about ext-json?
,phonebook_handler, {'emitter_format': 'ext-json'}),
url(r'^phonebooks
my emitters.py and handlers.py is same to the tutorial,... the different is my models.py
is there are any installation about ext-json?
,phonebook_handler, {'emitter_format': 'ext-json'}),
)
my emitters.py and handlers.py is same to the tutorial,... the different is my models.py
is there are any installation about ext-json?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在某个时候导入自定义发射器类,以便它被注册。
You need to import your custom emitter class at some point so that it gets registered.