使用502网关美丽的汤,Python的/ Django的 [英] 502 Bad Gateway using Beautiful Soup, Python/Django

查看:243
本文介绍了使用502网关美丽的汤,Python的/ Django的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Django在Python外壳美味的汤的作品。我也可以成功导入从BS4进口BeautifulSoup 进入views.py,但是当我打电话类似汤= BeautifulSoup(XML),我得到一个502错误网关错误。我跟我的主人,他们不能发现问题。任何想法?

Beautiful Soup works in the Python shell using Django. I can also successfully import from bs4 import BeautifulSoup into views.py, but when I call something like soup = BeautifulSoup(xml), I get a 502 Bad Gateway error. I talked to my host, and they could not find the problem. Any ideas?

请注意XML是 XML = urllib2.urlopen(\"http://isbndb.com/api/books.xml?access_key=000000&results=details&index1=isbn&value1=0000\").read(),但它在Python外壳(myproject的文件夹中)的作品,所以我不认为这就是问题所在。

Note the xml is xml = urllib2.urlopen("http://isbndb.com/api/books.xml?access_key=000000&results=details&index1=isbn&value1=0000").read(), but it works in the Python shell (within myproject folder), so I wouldn't think that's the problem.

推荐答案

这听起来像描述用Cython和mod_wsgi的之间的相互作用<一个href=\"https://techknowhow.library.emory.edu/blogs/branker/2010/07/30/django-lxml-wsgi-and-python-sub-inter$p$pter-magic\"相对=nofollow>此处,并在美丽的汤背景下探讨这里

This sounds like the interaction between Cython and mod_wsgi described here, and explored in a Beautiful Soup context here.

这篇关于使用502网关美丽的汤,Python的/ Django的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆