当前位置: 首页 > wzjs >正文

网站运营做内容我国中小企业名单

网站运营做内容,我国中小企业名单,网站推广实施计划,网络营销策划需要包括哪些内容模板语法及静态文件 1 多app创建 在主路由当中引入 include include()函数是Django.urls模块中的一个函数,它的作用是在urls.py文件中引入其他应用的URL模式。 from django.urls import path, include创建多个app python manage.py startapp project_one python ma…

模板语法及静态文件

1 多app创建

  • 在主路由当中引入 include

    include()函数是Django.urls模块中的一个函数,它的作用是在urls.py文件中引入其他应用的URL模式。

    from django.urls import path, include
    
  • 创建多个app

    python manage.py startapp project_one
    python manage.py startapp project_two
    
  • 主路由添加两个app的路由

    path('one/', include("project_one.urls"))
    path('two/', include("project_two.urls"))
    
    • 对应子路由
      # project_one
      path('index/one/data/', views.index_one),
      # 访问index_one视图路径:one/index/one/data/# project_two
      path('index/two/data/', views.index_two),
      # 访问index_two视图路径:two/index/two/data/
      

2 模板语法

2.1 变量

  • 变量的写法使用一个嵌套大括号{{ name }}

    def index_one(request):dict_data = {}dict_data["name"] = "张三"dict_data["love"] = ["篮球", "羽毛球", "足球"]return render(request, "two/index_one.html", dict_data)
    
    </--index_one.html--?>
    <h1>大家好,我是{{ name }}我喜欢{{ love.0 }}</h1>
    <h1>大家好,我是{{ name }}我喜欢{{ love.1 }}</h1>
    

2.2 标签

3 表单提交

<form method="post">{% csrf_token %}<input type="text" name="user" placeholder="用户名"><input type="password" name="pwd" placeholder="密码"><input type="submit" value="提交">
</form>

{% csrf_token %}是 Django 提供的防止伪装提交请求的功能。POST 方法提交的表格,必须有此标签。

def login(request):if request.method == "GET":return render(request, "two/login.html")else:username = request.POST.get("user")password = request.POST.get("pwd")print(username, password)if username == "admin" and password == "123456":# return HttpResponse("登录成功")# 重定向return redirect("/")else:return HttpResponse("登录失败")

文章转载自:

http://QxbrQ62t.jcfnL.cn
http://xly3ZLN7.jcfnL.cn
http://Pev4Z3ka.jcfnL.cn
http://7DGJLhQF.jcfnL.cn
http://D8Ar0Co4.jcfnL.cn
http://2HTSMigs.jcfnL.cn
http://wneJBFE4.jcfnL.cn
http://p3sxREee.jcfnL.cn
http://1pcNKo1x.jcfnL.cn
http://baPNQtgr.jcfnL.cn
http://YE6XiBuB.jcfnL.cn
http://lRrQcjwH.jcfnL.cn
http://LOlXxSna.jcfnL.cn
http://77JUN6My.jcfnL.cn
http://tmr52p6S.jcfnL.cn
http://OaN9704O.jcfnL.cn
http://KQmW5lwR.jcfnL.cn
http://pqifXF72.jcfnL.cn
http://wfEHywln.jcfnL.cn
http://WNTYR8sF.jcfnL.cn
http://m4J14TD3.jcfnL.cn
http://k0sXoyex.jcfnL.cn
http://P4eOzBJC.jcfnL.cn
http://A3208SYy.jcfnL.cn
http://94LMWe4j.jcfnL.cn
http://BVDOPF87.jcfnL.cn
http://pWWNFvGg.jcfnL.cn
http://pi3J6fr3.jcfnL.cn
http://IDjIvcbP.jcfnL.cn
http://WhxZVXOJ.jcfnL.cn
http://www.dtcms.com/wzjs/639312.html

相关文章:

  • 网站界面设计psWordPress和cos
  • 凡客做网站重庆雕塑制作
  • 商丘网站制作教程长沙网络推广代理
  • 嘉兴本地推广网站有哪些网站修改 iis6应用程序池
  • 深深圳的网站建设公司谷雨网页设计作业
  • 网站外链有多重要专门做名片的网站
  • 阿里云服务器 做网站免费无代码开发平台本地部署
  • 网站安全检测工具网站wordpress sydney主题
  • 自己做网站的给微信取个什么名字好河南网站优化
  • 河南核酸检测vip整站seo教程
  • 辽阳银梦网站建设微信直接下载安装
  • 天津网站设计 河西html5视频标签
  • 中天建设集团门户网站动漫制作专业零基础
  • 发布网站后备案找个人给我做电影网站
  • 网站信息更新如何做网站代发外链
  • 万网网站建设云南网站建设维护
  • 如何在国外社交网站上做原单外贸电子商务具体干嘛的
  • 广州做外贸网站建设暴雪vp
  • 有个网站叫设计什么网站代理违法吗
  • 系统的网站建设教程新乡专业做网站公司
  • 辽宁城乡建设集团官方网站如何挑选网站建设平台
  • 那个网站可教做课件好怎么做网站何做网站
  • 影视vip网站建设教程女生学市场营销好吗
  • 17网站一起做网店杭州支持wordpress
  • 高校网站设计方案百度指数下载
  • wap卖料建站系统公司网站建设哪家正规
  • 做名片制作网站有什么湖州广告设计公司
  • 安徽建站平台烟台网络科技有限公司
  • 黄江二手车东莞网站建设南昌net网站开发
  • 班组建设网站wordpress菜单栏图标