Python 500因特网服务器错误
我正在尝试从facebook api获取数据。 下面是向django应用程序发送消息的代码 我所做的是将身份合并到asd"qe"形式中,并尝试 把表格分成我的django部分 然而,我已经发布了500个内部服务器错误来解决这个问题Python 500因特网服务器错误,python,django,facebook,Python,Django,Facebook,我正在尝试从facebook api获取数据。 下面是向django应用程序发送消息的代码 我所做的是将身份合并到asd"qe"形式中,并尝试 把表格分成我的django部分 然而,我已经发布了500个内部服务器错误来解决这个问题 var getPosts = function (response) { if(response.data != null) { for (var i=0; i<response.data.length; i++) { consol
var getPosts = function (response)
{
if(response.data != null)
{
for (var i=0; i<response.data.length; i++)
{
console.log(response.data[i].message)
if(response.data[i].message != null)
{
message = message + response.data[i].message;
message = message + '%%%%%'
console.log(message)
}
}
if(response.paging != null){
nextPage = response.paging.next;
console.log(nextPage);
$.get(nextPage, getPosts, "json")
}
else $.post('/get-message/',{message: message,csrfmiddlewaretoken:'{{csrf_token}}'});
}
}
FB.api('/me/feed', function(response)
{
if (response.data.length >0){
for (var i=0; i<response.data.length; i++)
{
console.log(response.data[i].message)
if(response.data[i].message != null)
{
message = message + response.data[i].message;
message = message + '%%%%%'
console.log(message)
}
}
console.log(message)
if(response.paging != null){
nextPage = response.paging.next;
console.log(nextPage);
$.get(nextPage, getPosts, "json")
}
else $.post('/get-message/',{message: message, csrfmiddlewaretoken:'{{csrf_token}}' });
}
我的URL.py
urlpatterns = patterns('',
url(r'^$', 'suv.views.home'),
url(r'^get-message', 'suv.views.get_message'),
顺便问一下:有没有一种方法可以将数组添加到django中,django是如何处理的
非常感谢这是我去那里时遇到的错误。你也一样吗
ImportError at /get-message/
No module named home
Request Method: GET
Request URL: http://chaop.webfactional.com/get-message/
Django Version: 1.5.1
Exception Type: ImportError
Exception Value:
No module named home
Exception Location: /home/chaop/webapps/my_app2/lib/python2.7/django/utils/importlib.py in import_module, line 35
Python Executable: /usr/local/bin/python
Python Version: 2.7.5
Python Path:
['/home/chaop/webapps/my_app2',
'/home/chaop/webapps/my_app2/myproject',
'/home/chaop/webapps/my_app2/lib/python2.7',
'/home/chaop/lib/python2.7',
'/usr/local/lib/python27.zip',
'/usr/local/lib/python2.7',
'/usr/local/lib/python2.7/plat-linux2',
'/usr/local/lib/python2.7/lib-tk',
'/usr/local/lib/python2.7/lib-old',
'/usr/local/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/site-packages',
'/usr/local/lib/python2.7/site-packages/PIL']
Server time: Mon, 24 Mar 2014 02:45:39 -0500
如果是,请查看importlib.py第35行 这是一个django服务器,因此您需要基于django运行。是的,我想这可能是一个安装问题,我为什么会得到响应。通常,当我收到500条信息时,是因为我错过了一条;10次中有9次。
ImportError at /get-message/
No module named home
Request Method: GET
Request URL: http://chaop.webfactional.com/get-message/
Django Version: 1.5.1
Exception Type: ImportError
Exception Value:
No module named home
Exception Location: /home/chaop/webapps/my_app2/lib/python2.7/django/utils/importlib.py in import_module, line 35
Python Executable: /usr/local/bin/python
Python Version: 2.7.5
Python Path:
['/home/chaop/webapps/my_app2',
'/home/chaop/webapps/my_app2/myproject',
'/home/chaop/webapps/my_app2/lib/python2.7',
'/home/chaop/lib/python2.7',
'/usr/local/lib/python27.zip',
'/usr/local/lib/python2.7',
'/usr/local/lib/python2.7/plat-linux2',
'/usr/local/lib/python2.7/lib-tk',
'/usr/local/lib/python2.7/lib-old',
'/usr/local/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/site-packages',
'/usr/local/lib/python2.7/site-packages/PIL']
Server time: Mon, 24 Mar 2014 02:45:39 -0500