In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you Wechat public account developer certification uwsgi combined with web.py example analysis, I hope you will learn something after reading this article, let's discuss it!
[root@mail ~] # uname-aLinux mail.vtata.cn 2.6.18-128.el5xen # 1 SMP Wed Jan 21 11:12:42 EST 2009 x 86 "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
The first is to install the required programs, because the Python that comes with Centos is 2.4. if it is not updated to 2.7, there will be problems such as module import errors.
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-is @ / 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
This is a combination of uwsgi and nginx. Please participate in the previous article on the integration of uwsgi and nginx.
The verification code is written as follows:
File name: 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 ()
Start uwsgi after starting nginx. The startup process is as follows:
[root@mail html] # uwsgi-s 127.0.0.1 webinput*** Starting uWSGI 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 you are running uWSGI without its master process manager 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 to 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)
Open the Wechat public platform interface, and set it in the advanced features as shown in the figure:
After reading this article, I believe you have a certain understanding of "Wechat public account developer certification uwsgi combined with web.py sample analysis". If you want to know more about it, welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.