Django项目配置微信相关安全文件路由url访问
时间:2020-06-26 22:26:47
收藏:0
阅读:81
从微信下载安全验证文件上传到服务器django项目的templates目录下
配置相应的url路由确保能能通过微信验证
from django.views.generic import TemplateView from django.conf.urls import url, include from django.contrib import admin from App import views urlpatterns = [ url(r‘^admin/‘, admin.site.urls), #url(r‘^$‘,TemplateView.as_view(template_name="pr.html"),name="index"), url(r‘^ruRSb2URBu.txt$‘, TemplateView.as_view(template_name="ruRSb2URBu.txt", content_type="text/plain"), name="test"), url(r‘^$‘, views.price_record, name=‘index‘), url(r‘^survey/‘, include(‘App.urls‘, namespace=‘survey‘)), ]
通过域名/ruRSb2URBu.txt
如图所示
评论(0)