腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
返回腾讯云官网
敏而好学
专栏作者
举报
85
文章
169962
阅读量
17
订阅数
订阅专栏
申请加入专栏
全部文章
linux
编程算法
http
https
centos
网络安全
node.js
缓存
python
存储
数据迁移
虚拟化
流计算 Oceanus
分布式
tcp/ip
bug
html
ide
unix
solaris
SSL 证书
腾讯云测试服务
ssh
面向对象编程
kernel
kvm
monitor
其他
java
xml
arm
硬件开发
数据库
oracle
sql
git
github
api
搜索引擎
windows server
apache
nginx
tornado
文件存储
网站
容器
kubernetes
运维
openstack
flash
rpc
gcc
数据分析
agent
alert
attributes
block
data
ddd
difference
disk
error
file
gpt
host
iterm2
kill
list
localhost
offline
pool
preferences
preview
release
rpm
search
send
sendmail
service
status
swap
text
操作系统
测试
服务
后台
互联网
集群
监控
进程
内存
内核
通信
虚拟机
搜索文章
搜索
搜索
关闭
Easy Basic HTTP authentication with Tornado
tornado
http
I recently got a chance to play around with Tornado, which is pretty neat (although that certainly isn’t news). One thing that I tried to do pretty quickly and had a hard time with was Basic authentication (you know, the little “so-and-so requires a username and password” pop-up). Paulo Suzart posted a working example over on gist, but it was a bit light on context, and Dhanan Jaynene’s request interceptors are a bit overkill for this purpose (although very useful for more complex behavior!). Let’s start with the “hello world” example from theTornado site, and I’ll show you what I’ve cooked up. I’m only an hour or two into exploring Tornado, like I hinted at above, so if you see any room for improvement, I’d love to hear from you. (I’ve made all the code I’ve written very verbose in the hopes that’ll help people understand and customize it without much trial-and-error. Feel free to tighten things up.)
党志强
2020-02-11
935
0
没有更多了
社区活动
腾讯技术创作狂欢月
“码”上创作 21 天,分 10000 元奖品池!
立即发文
Python精品学习库
代码在线跑,知识轻松学
立即查看
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
立即体验
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
立即查看
领券
问题归档
专栏文章
快讯文章归档
关键词归档
开发者手册归档
开发者手册 Section 归档