??? ??? ??? ??? ?? WeChat? ??? ???? ?? ??? ?????. ?? ?? ???? ?? WeChat ??? ??? ???? ????. ???? ??. ??? ???? ???? ?? ??? ?? ???? ??? ??? ? ????.
?: ? ??? ?????? ?? ??? ??? "WeChat"?? ???? ????? ?? ??? ???? ??? ?????. "WeChat"? ????? ????? ? ?? ?? ????? ?? ??? ??? Sina "????" ???? ???? WeChat ?? ??? ? ?? ??? ?? ???????.
20.1. ?? ?? ??
WeChat ?? ?? ??? "WeChat ?? ??? ????? ????"? ?? ?? ??? ??? ?????
20.1.1.?? ?? ??? ?? ?? ???
??? ??->?? ??->? ??????.
?? ?? ??? ???? "WeChat" SDK ?? ??? ?? ?? ??? ????? ?? ???? ?????. "WeChat" ??? ?? ??? ?? ??? ??? ? ??? "WeChat" ??? ???? ????? ?? ???? ?????.
20.1.2. ??? ?? wechat? URL? ???? ???.
??? ????? wechat??? ? ?? ????. ????? "WeChat"? ?????. "??? ??? ???? ?? ??? ????? ??? ??? ??? ????.
???? ?? wechat? views.py? ?? ??? ?????.
from django.http import HttpResponse
from django.template import RequestContext
from django.views. decorators.csrf ???? csrf_exempt
???? ??
???? hashlib
TOKEN = "mysaesite" #? WeChat ??? ???? ???
@csrf_exemptdefwechat(request):????if?request.method?==?'GET': ????????response?=?HttpResponse(checkSignature(request),content_type="text/plain")???????? ????????return?response????else:???????? ????????return?Nonedef?checkSignature(request):????global?TOKEN ????signature?=?request.GET.get("signature",?None) ????timestamp?=?request.GET.get("timestamp",?None) ????nonce?=?request.GET.get("nonce",?None) ????echoStr?=?request.GET.get("echostr",None) ????token?=?TOKEN ????tmpList?=?[token,timestamp,nonce] ????tmpList.sort() ????tmpstr?=?"%s%s%s"?%?tuple(tmpList) ????tmpstr?=?hashlib.sha1(tmpstr).hexdigest()???? ????if?tmpstr?==?signature:???????? ????return?echoStr???? ????else:???????? ????return?None
?? ?? mysite? urls.py? ???? wechat url ???? ?????.
"""Definition?of?urls?for?mysite."""from?django.conf.urls?import?patterns,?include,?url#?Uncomment?the?next?two?lines?to?enable?the?admin:#?from?django.contrib?import?admin#?admin.autodiscover()from?inventory?import?viewsimport?wechat.viewsurlpatterns?=?patterns('',????#?Examples: ????#?url(r'^$',?'mysite.views.home',?name='home'), ????#?url(r'^mysite/',?include('mysite.mysite.urls')), ????#?Uncomment?the?admin/doc?line?below?to?enable?admin?documentation: ????#?url(r'^admin/doc/',?include('django.contrib.admindocs.urls')), ????#?Uncomment?the?next?line?to?enable?the?admin: ????#?url(r'^admin/',?include(admin.site.urls)), ????url(r'^AddInStockBill/$',?views.AddInStockBill), ????url(r'^AddItem/$',?views.AddItem), ????url(r'^success/$',?views.success),? ????url(r'^search/$',views.search),? ????url(r'^inventoryQuery/$',views.inventoryQuery), ????url(r'^getInventoryByItemName/$',views.getInventoryByItemName), ????url(r'^inventoryQueryExtjs/$',views.inventoryQueryExtjs), ????url(r'^inventoryQueryBootstrap/$',views.inventoryQueryBootstrap),????url(r'^wechat/$',wechat.views.wechat),)
???? urls.py ??? wechat ? ???? ? ??? Sina Cloud? ?????? wechat? ???? ? ?? ???.
?? ?? ??? ???? ?? ??????? ?? ??? ???? ??? ?? ?? ?? ???? ?????.
20.1.3. ?? ??
checkSignature ??? ??? GET ??? "WeChat" ???? ??? ???? ????. ??? WeChat ???? ?? ?? echoStr ???? ??? ????. ??? ??? ???? ?????
20.2.??
?? WeChat ?? ???? ??? ? ???? ??? ???????. ?? ???? ??? ?? ???? WeChat ?? ??? ??? ???? ??? ???????.
Python ?? ?? ? ?? ?? 20-WeChat ?? ??? ??? ? ?? ??? ??? PHP ??? ????? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)