TopLevelLookupException:找不到uri的模板

2024-09-30 04:32:22 发布

您现在位置:Python中文网/ 问答频道 /正文

当我想启动金字塔服务器时,它返回TopLevelLookupException: Can not locate template for uri错误。请解释一下问题出在哪里

from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
from pyramid.view import view_config
import tweepy
import os

consumer_key=""
consumer_secret=""
access_key = ""
access_secret = "" 
here = os.path.dirname(os.path.abspath(__file__))

也许,问题出在这个“这里”物体上。在

^{pr2}$

Tags: pathkeyfromimportviewpyramidconfigsecret
1条回答
网友
1楼 · 发布于 2024-09-30 04:32:22

斯威迪现在在工作

def twitterfeed(request):
   auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
   auth.set_access_token(access_key, access_secret)
   api = tweepy.API(auth)
   statuses =  tweepy.Cursor(api.friends_timeline).items(20)
   data = [s.text.encode('utf8') for s in statuses]
   return {"data": data}
#...
#...
#...
config = Configurator(settings=settings)

相关问题 更多 >

    热门问题