微信公众账号开发者认证之uwsgi结合web.py的示例分析
发表于:2025-11-14 作者:千家信息网编辑
千家信息网最后更新 2025年11月14日,小编给大家分享一下微信公众账号开发者认证之uwsgi结合web.py的示例分析,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧![root@mail ~]# uname -aLinux
千家信息网最后更新 2025年11月14日微信公众账号开发者认证之uwsgi结合web.py的示例分析
小编给大家分享一下微信公众账号开发者认证之uwsgi结合web.py的示例分析,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!
[root@mail ~]# uname -aLinux mail.vtata.cn 2.6.18-128.el5xen #1 SMP Wed Jan 21 11:12:42 EST 2009 x86_64 x86_64 x86_64 GNU/Linux[root@mail ~]# cat /etc/redhat-release CentOS release 5.3 (Final)Python Version:[root@mail ~]# pythonPython 2.7.5 (default, Jun 14 2013, 18:21:34) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2Type "help", "copyright", "credits" or "license" for more informationuwsgi Version:uWSGI 1.4.9web.py Version:web.py-0.37
首先是安装所需程序,因为Centos自带的Python是2.4,如果不更新至2.7会发生模块导入错误等问题,
tar xvf Python-2.7.5.tgzcd Python-2.7.5./configure && make all && make install && make distcleanmv /usr/bin/python /usr/bin/python.bakln -sv /usr/local/bin/python2.7 /usr/bin/pythonsed -i s@/usr/bin/python@/usr/bin/python2.4@ /usr/bin/yumtar zxvf uwsgi-1.4.9.tar.gzcd uwsgi-1.4.9python uwsgiconfig.py --buildpython setup.py installtar zxvf web.py-0.37.tar.gzcd web.py-0.37python setup.py install
本次是通过uwsgi与nginx结合进行使用,关于uwsgi与nginx整合请参加前一篇文章。
编写验证代码如下:
文件名:webinput.py
import webimport hashliburls = ( '/','index')class index: def GET(self): token='shiji' sign = web.input() tmplist = [token,sign.timestamp,sign.nonce] tmplist.sort() tmpstr = "%s%s%s"%tuple(tmplist) tmpstr = hashlib.sha1(tmpstr).hexdigest() if tmpstr == sign.signature: return sign.echostr else: return Noneapp = web.application(urls,globals())application = app.wsgifunc()
启动nginx后启动uwsgi,启动过程如下:
[root@mail html]# uwsgi -s 127.0.0.1:9000 -w webinput*** Starting uWSGI 1.4.9 (64bit) on [Mon Jun 17 17:19:16 2013] ***compiled with version: 4.1.2 20080704 (Red Hat 4.1.2-44) on 17 June 2013 17:15:20os: Linux-2.6.18-128.el5xen #1 SMP Wed Jan 21 11:12:42 EST 2009nodename: mail.vtata.cnmachine: x86_64clock source: unixpcre jit disableddetected number of CPU cores: 8current working directory: /usr/local/nginx/htmldetected binary path: /usr/local/bin/uwsgiuWSGI running as root, you can use --uid/--gid/--chroot options*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ****** WARNING: you are running uWSGI without its master process manager ***your processes number limit is 61234your memory page size is 4096 bytesdetected max file descriptor number: 52100lock engine: pthread robust mutexesuwsgi socket 0 bound to TCP address 127.0.0.1:9000 fd 3Python version: 2.7.5 (default, Jun 14 2013, 18:21:34) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]*** Python threads support is disabled. You can enable it with --enable-threads ***Python main interpreter initialized at 0xfe30520your server socket listen backlog is limited to 100 connectionsmapped 72424 bytes (70 KB) for 1 cores*** Operational MODE: single process ***WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0xfe30520 pid: 10775 (default app)*** uWSGI is running in multiple interpreter mode ***spawned uWSGI worker 1 (and the only) (pid: 10775, cores: 1)13712480011371460796shiji[pid: 10775|app: 0|req: 1/1] 101.226.33.171 () {34 vars in 616 bytes} [Mon Jun 17 17:19:43 2013] GET /?signature=915c123b81282828ae1eecdc202336d07dfc15d8&echostr=5889465363321509055×tamp=1371460796&nonce=1371248001 => generated 4 bytes in 2 msecs (HTTP/1.0 200) 0 headers in 19 bytes (2 switches on core 0)打开微信公众平台界面,在高级功能里面进行设置如图:

看完了这篇文章,相信你对"微信公众账号开发者认证之uwsgi结合web.py的示例分析"有了一定的了解,如果想了解更多相关知识,欢迎关注行业资讯频道,感谢各位的阅读!
公众
篇文章
开发者
示例
账号
分析
开发
认证
高级
代码
功能
完了
平台
文件
文件名
更多
模块
界面
知识
程序
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
nosql数据库有哪些储存方法
上海慧体网络技术有限公司
国家网络安全日宣传语
三维建模软件开发设计
网页服务器为什么要备案
贵州pdu服务器电源咨询
网络通信和软件开发
红思网络技术有限公司怎么样
河源无线软件开发价钱
太原软件开发专业学校
腾讯云17元轻量服务器
iphone 网络安全
互联网 华中科技大学系
四川省图书馆有万德数据库吗
网络安全攻防技术的摘要
数据库如何查看数据字典
西门子历史服务器的安装
收信服务器怎么填
计算机网络技术问题有哪些
环保行业软件开发有限公司
牡丹江软件开发培训中心
贵州pdu服务器电源咨询
逍遥网络安全手抄报
互联网大会华云科技
万象会员数据库
数据库单元格合并不了
网络安全与信息化 中央
西门子历史服务器的安装
azp与az云服务器
公安机关网络安全知识考试