1. 写views
views.py代码块
1.在前端以/article/{{ article.id }}这种方式请求后台,
参数配置在urls.py中path('category/<int:id>',views.category),#<int:id>:配置参数,id必须和views里的方法的变量要一致,参数类型支持int,str等
在view方法中定义变量,变量名和urls.py中一致
2.在前端以url?key=value
在views中用request.GET.get('key')获取参数
3.在前端以url key-value form表单、ajax等参数上传的
在views中用request.POST.get('key')来获取参数
4.在前端以json,或者xml等格式请求后台
在views用request.body来获取参数
from django.shortcuts import render
from django.shortcuts import HttpResponse
from . import models # Create your views here.
# 写逻辑的地方 def index(request):
# return HttpResponse('hello django!')
categories = models.Category.objects.all()
articles = models.Article.objects.all()
title = 'my blog'
return render(request, 'index.html', {'title': title, 'categories': categories, 'articles': articles}) # 第三个参数,把值传到html页面上 def get_sign(request):
print(request.method) # 请求方式
print(request.body) # 请求体
print(request.META) # 请求头
print(request.GET) # url里面的参数都在GET url? a=1&b=2
print(request.POST) # POST中的参数 k-v,k1=v1
print(request.FILES) # 文件
print(request.COOKIES) # cookies
return HttpResponse('sign') def category_view(request):
c = models.Category.objects.all() # 查询所有的数据
for i in c:
print(i.name)
print(i.create_time)
print(i.update_time)
print('=====================')
s = models.Category.objects.get(id=3) # 使用get,必须要保证返回的只有1条结果
print(s.name)
f = models.Category.objects.filter(name='java', id=3) # 进行过滤,返回多条结果 result = models.Category.objects.filter(name='mysql').exists() # 使用过滤后,利用exists方法判断是否存在
print(result)
result = models.Category.objects.filter(name='java').count() # 使用过滤后,利用count方法统计返回条数
print(result)
return HttpResponse('ok') def category(request, id):
categories = models.Category.objects.all()
articles = models.Article.objects.filter(category_id=id)
print(articles.get(id=id),id)
# print(articles.first()) # 返回第一个
# print(articles.last()) # 返回最后一个
return render(request, 'category.html', {'articles': articles, 'categories': categories}) def detail(request, id):
article = models.Article.objects.get(id=id)
# print(id)
# print(article.read_count)
article.read_count += 1
article.save()
return render(request, 'detail.html', {'article': article})
2. 配置urls
from django.contrib import admin
from django.urls import path
from user import views urlpatterns = [
path('admin/', admin.site.urls),
path('index/', views.index),
path('get_sign', views.get_sign),
path('category_view', views.category_view),
path('category/<int:id>', views.category),
path('article/<int:id>', views.detail),
]
4. 前端页面
4.1 index.html代码
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="referrer" content="origin">
<!-- TDK and ICO -->
<title>Tend to Code_一个使用django和bootstrap搭建的个人博客_TendCode</title> <meta name="description"
content="TendCode是一个Django搭建的博客,本网站后端使用Django框架搭建,前端使用Bootstrap框架,主要分享博主在Python以及其他编程语言的学习心得。">
<meta name="keywords" content="Python自学,Python爬虫,Django博客,Python web开发,个人博客">
<!--站长验证--> <link rel="shortcut icon" href="/static/blog/img/favicon.ico" type="image/x-icon"/>
<!-- Bootstrap and font-awesome CSS -->
<link href="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<script src="/static/js/headroom.min.js"></script>
<!-- blog CSS -->
<link href="/static/css/base.css" rel="stylesheet"> <!--根据cookies判断是否启用暗色主题--> </head>
<body>
<!--导航开始--> <nav class="navbar navbar-expand-md bg-white fixed-top blog-navbar py-md-0">
<a class="navbar-brand d-md-none d-lg-block" id="site-logo-name" href="/">
<strong class="px-2">{{ title }}</strong>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item mr-2"> <a class="nav-link py-md-3 active" href="/"><i class="fa fa-home mr-1"></i>首页<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item mr-2"> <a class="nav-link py-md-3 " href="./archive.html"><i class="fa fa-sitemap mr-1"></i>归档</a>
</li> <form class="nav-item navbar-form mr-2 py-md-2" role="search" method="get" id="searchform"
action="/search/">
<div class="input-group">
<input type="search" name="q" class="form-control rounded-0" placeholder="站内搜索" autocomplete="off"
required=True>
<div class="input-group-btn">
<button class="btn btn-info rounded-0" type="submit"><i class="fa fa-search"></i></button>
</div>
</div><!-- /input-group -->
</form>
</ul> </div>
</nav> <!--导航结束--> <!--消息块--> <!--回到顶部按钮-->
<div class="text-center" id="to-top">
<i class="fa fa-chevron-up" id="btn-top" title="回到顶部"></i>
</div> <!--主要内容块-->
<main>
<div class="container">
<div class="row">
<div class="col-lg-8"> <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators"> <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li> <li data-target="#carouselExampleIndicators" data-slide-to="1"></li> <li data-target="#carouselExampleIndicators" data-slide-to="2"></li> <li data-target="#carouselExampleIndicators" data-slide-to="3"></li> </ol>
<div class="carousel-inner"> <div class="carousel-item active"> <a href="./detail.html">
<img class="w-100" src="https://tendcode.com/cdn/article/180415/jiandan.png"
alt="容器化部署博客(3)—— 5分钟完成项目迁移">
</a>
</div> <div class="carousel-item"> <a href="/article/set-up-django-with-nginx-and-gunicorn/">
<img class="w-100" src="https://tendcode.com/cdn/article/180415/jiandan.png"
alt="在 Linux 服务器上使用 Nginx + Gunicorn 部署 Django 项目的正确姿势">
</a>
</div> <div class="carousel-item"> <a href="/article/virtualenv-for-python/">
<img class="w-100" src="https://tendcode.com/cdn/article/180415/jiandan.png"
alt="Python虚拟环境Virtualenv分别在Windows和Linux上的安装和使用">
</a>
</div> <div class="carousel-item"> <a href="/article/jiandan-meizi-spider/">
<img class="w-100" src="https://tendcode.com/cdn/article/180415/jiandan.png" alt="煎蛋网妹子图爬虫">
</a>
</div> </div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<div class="text-secondary font-weight-bold py-2 f-15 choice"> <a class="pb-2 active" href="/">
<i class="fa fa-bars mr-1"></i>时间排序</a> </div> <div class="summary-list">
{% for article in articles %}
<div class="media mb-1 mb-sm-2 p-2 p-lg-3">
<div class="align-self-center mr-2 mr-lg-3 w-25 modal-open">
<a href="./detail.html" target="_blank">
<img class="w-100 article-img" src="https://tendcode.com/cdn/article/191029/python_shell.png"
alt="Python 模板渲染库 yaml 和 jinja2 的实战经验分享">
</a>
</div>
<div class="media-body"> <div class="text-muted mb-2 f-12"> <img class="avatar"
src="https://tendcode.com/media/avatar/2019/07/27/91ef76c6a7efce1b99717f97a851f3deb48f6510.png"
alt="Hopetree"> <span>Hopetree</span>
<span><i class="fa fa-calendar-times-o ml-2 mr-1"></i>2 周,3天前</span>
</div>
<h2 class="mt-0 font-weight-bold text-info f-17">
<a href="/article/{{ article.id }}" target="_blank">{{ article.title }}</a>
</h2>
<p class="d-none d-sm-block mb-2 f-15">{{ article.content }}</p> <div class="text-muted mb-0 f-12">
<a class="cate" href="/category/{{ article.category.id }}" title="查看当前分类下更多文章">
<i class="fa fa-book mr-1"></i>{{ article.category.name }}</a>
<span><i class="fa fa-eye ml-2 mr-1"></i>{{ article.read_count }}</span>
<a href="/article/yaml_and_jinja2/#comment-block" target="_blank" title="查看文章评论">
<i class="fa fa-comments ml-2 mr-1"></i>8</a>
</div>
</div>
</div>
{% endfor %} </div>
<div class="text-center mt-2 mt-sm-1 mt-md-0 mb-3 f-16"> <span class="text-secondary" title="当前页已经是首页">上一页</span> <span class="mx-2">第 1 / 4 页</span> <a class="text-success" href="?page=2">下一页</a> </div>
</div>
<div class="col-lg-4"> <!--个人空间-->
<div class="card border-0 rounded-0 px-3 mb-2 mb-md-3 d-none d-lg-block" id="home-card">
<div class="card-header bg-white px-0">
<strong><i class="fa fa-paper-plane mr-2 f-17"></i>个人空间</strong>
</div>
<div class="card-body px-0 pt-3 pb-1">
<div class="row text-center">
<div class="col">
<a href="https://github.com/Hopetree" target="_blank" title="进入博主的Github查看博客源码">
<img style="max-width:40px" alt="博主的github" src="https://tendcode.com/static/blog/img/github.png">
<p class="mt-2">Github</p>
</a>
</div>
<div class="col">
<a href="/timeline/" target="_blank" title="查看网站建站历程">
<img style="max-width:40px" alt="网站的建站历程" src="https://tendcode.com/static/blog/img/blog.png">
<p class="mt-2">Timeline</p>
</a>
</div> <div class="col">
<a href="/timeline/" target="_blank" title="查看网站建站历程">
<img style="max-width:40px" alt="网站的建站历程" src="https://tendcode.com/static/blog/img/blog.png">
<p class="mt-2">Timeline</p>
</a>
</div> </div>
</div>
</div>
<!--文章分类-->
<div class="card border-0 rounded-0 px-3 mb-2 mb-md-3" id="category-card">
<div class="card-header bg-white px-0">
<strong><i class="fa fa-book mr-2 f-17"></i>文章分类</strong>
</div> <ul class="list-group list-group-flush f-16">
{% for category in categories %}
<li class="list-group-item d-flex justify-content-between align-items-center pr-2 py-2">
<a class="category-item" href="/category/{{ category.id }}"
title="查看【CI/CD】分类下所有文章">{{ category.name }}</a>
<span class="badge text-center" title="当前分类下有6篇文章">{{ category.article_set.count }}</span>
</li>
{% endfor %}
</ul>
</div>
<!--标签云-->
<div class="card border-0 rounded-0 px-3 mb-2 mb-md-3" id="tag-card">
<div class="card-header bg-white px-0">
<strong><i class="fa fa-tags mr-2 f-17"></i>标 签 云</strong>
</div>
<div class="card-body px-0 py-3">
<div class="tag-cloud"> <a href="/tag/Virtualenv/" class="tags f-16" id="tag-1"
title="【Virtualenv】标签下有3篇文章">Virtualenv</a> <a href="/tag/Web-development/" class="tags f-16" id="tag-2"
title="【后端开发】标签下有10篇文章">后端开发</a> <a href="/tag/python-crawler/" class="tags f-16" id="tag-3"
title="【Python爬虫】标签下有8篇文章">Python爬虫</a> <a href="/tag/MD5/" class="tags f-16" id="tag-4"
title="【MD5加密】标签下有2篇文章">MD5加密</a> <a href="/tag/Requests/" class="tags f-16" id="tag-5"
title="【Requests】标签下有4篇文章">Requests</a> <a href="/tag/threading/" class="tags f-16" id="tag-6"
title="【多线程】标签下有4篇文章">多线程</a> <a href="/tag/multiprocessing/" class="tags f-16" id="tag-7"
title="【多进程】标签下有2篇文章">多进程</a> <a href="/tag/Django/" class="tags f-16" id="tag-8"
title="【Django】标签下有10篇文章">Django</a> <a href="/tag/MySQL/" class="tags f-16" id="tag-9"
title="【MySQL】标签下有4篇文章">MySQL</a> <a href="/tag/database/" class="tags f-16" id="tag-10"
title="【数据库】标签下有2篇文章">数据库</a> <a href="/tag/Nginx/" class="tags f-16" id="tag-11"
title="【Nginx】标签下有4篇文章">Nginx</a> <a href="/tag/Gunicorn/" class="tags f-16" id="tag-12"
title="【Gunicorn】标签下有1篇文章">Gunicorn</a> <a href="/tag/Redis/" class="tags f-16" id="tag-13"
title="【Redis】标签下有2篇文章">Redis</a> <a href="/tag/django-redis/" class="tags f-16" id="tag-14"
title="【django-redis】标签下有1篇文章">django-redis</a> <a href="/tag/cache/" class="tags f-16" id="tag-15"
title="【Cache】标签下有1篇文章">Cache</a> <a href="/tag/Linux/" class="tags f-16" id="tag-16"
title="【Linux】标签下有8篇文章">Linux</a> <a href="/tag/crontab/" class="tags f-16" id="tag-17"
title="【crontab】标签下有1篇文章">crontab</a> <a href="/tag/PhantomJS/" class="tags f-16" id="tag-18"
title="【PhantomJS】标签下有1篇文章">PhantomJS</a> <a href="/tag/selenium/" class="tags f-16" id="tag-19"
title="【Selenium】标签下有2篇文章">Selenium</a> <a href="/tag/queue/" class="tags f-16" id="tag-20"
title="【Queue】标签下有1篇文章">Queue</a> <a href="/tag/configparser/" class="tags f-16" id="tag-21"
title="【configparser】标签下有1篇文章">configparser</a> <a href="/tag/paramiko/" class="tags f-16" id="tag-22"
title="【paramiko】标签下有1篇文章">paramiko</a> <a href="/tag/SSH/" class="tags f-16" id="tag-23"
title="【SSH】标签下有3篇文章">SSH</a> <a href="/tag/shell/" class="tags f-16" id="tag-24"
title="【shell】标签下有4篇文章">shell</a> <a href="/tag/Scrapy/" class="tags f-16" id="tag-25"
title="【Scrapy】标签下有2篇文章">Scrapy</a> <a href="/tag/docker/" class="tags f-16" id="tag-26"
title="【Docker】标签下有10篇文章">Docker</a> <a href="/tag/docker-compose/" class="tags f-16" id="tag-27"
title="【docker-compose】标签下有5篇文章">docker-compose</a> <a href="/tag/docker-build/" class="tags f-16" id="tag-28"
title="【容器化】标签下有8篇文章">容器化</a> <a href="/tag/centos/" class="tags f-16" id="tag-29"
title="【CentOS】标签下有2篇文章">CentOS</a> <a href="/tag/pip/" class="tags f-16" id="tag-30"
title="【pip】标签下有1篇文章">pip</a> <a href="/tag/argparse/" class="tags f-16" id="tag-31"
title="【argparse】标签下有1篇文章">argparse</a> <a href="/tag/click/" class="tags f-16" id="tag-32"
title="【Click】标签下有1篇文章">Click</a> <a href="/tag/OAuth2/" class="tags f-16" id="tag-33"
title="【OAuth2.0】标签下有1篇文章">OAuth2.0</a> <a href="/tag/django-allauth/" class="tags f-16" id="tag-34"
title="【django-allauth】标签下有1篇文章">django-allauth</a> <a href="/tag/git/" class="tags f-16" id="tag-35"
title="【Git】标签下有2篇文章">Git</a> <a href="/tag/ci-cd/" class="tags f-16" id="tag-36"
title="【CI/CD】标签下有6篇文章">CI/CD</a> <a href="/tag/Jenkins/" class="tags f-16" id="tag-37"
title="【Jenkins】标签下有6篇文章">Jenkins</a> <a href="/tag/Vue/" class="tags f-16" id="tag-38"
title="【Vue.js】标签下有3篇文章">Vue.js</a> <a href="/tag/ansible/" class="tags f-16" id="tag-39"
title="【Ansible】标签下有1篇文章">Ansible</a> <a href="/tag/jinja2/" class="tags f-16" id="tag-40"
title="【jinja2】标签下有1篇文章">jinja2</a> <a href="/tag/yaml/" class="tags f-16" id="tag-41"
title="【YAML】标签下有1篇文章">YAML</a> </div>
</div>
</div>
<!--友链-->
<div class="d-none d-lg-block">
<div class="card border-0 rounded-0 px-3 mb-2 mb-md-3" id="friends-card">
<div class="card-header bg-white px-0">
<strong><i class="fa fa-link mr-2 f-17"></i>友情链接</strong>
</div>
<div class="card-body px-0 py-3">
<div class="tool-list"> <div class="w-50 float-left text-center mb-2">
<div class="mx-2">
<a href="https://github.com/Hopetree/izone" title="izone 博客项目的源代码"
target="_blank">
博客源码</a>
</div>
</div> <div class="w-50 float-left text-center mb-2">
<div class="mx-2">
<a href="https://frostming.com" title="一个基于 Flask 开发的博客" target="_blank">
Frost's Blog</a>
</div>
</div> <div class="w-50 float-left text-center mb-2">
<div class="mx-2">
<a href="https://zmrenwu.com" title="Django 博客教程分享者" target="_blank">
追梦人物</a>
</div>
</div> <div class="w-50 float-left text-center mb-2">
<div class="mx-2">
<a href="https://www.dusaiphoto.com/" title="Django 搭建的博客,分享博客教程"
target="_blank">
杜赛的个人网站</a>
</div>
</div> <div class="w-50 float-left text-center mb-2">
<div class="mx-2">
<a href="https://www.jerrycoding.com/" title="Jerry 的个人博客" target="_blank">
Jerry Coding</a>
</div>
</div> <div class="w-50 float-left text-center mb-2">
<div class="mx-2">
<a href="https://boywithacoin.cn/" title="Stray_Camel的个人技术博客" target="_blank">
Stray_Camel</a>
</div>
</div> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<!--js cookie 插件-->
<script src="/static/js/js.cookie.min.js?v=20191123.12"></script>
<script src="https://cdn.bootcss.com/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script>
$(function () {
var myElement = document.querySelector(".blog-navbar");
var headroom = new Headroom(myElement);
headroom.init()
});
</script>
<script src="/static/js/base.js?v=20191123.0909890"></script> <footer class="container-fluid mt-4 py-0">
<div class="card-body text-center px-0 f-14">
<p class="card-text mb-1">Copyright © <span id="year-info"></span>
Powered by Django.
</p> </div>
</footer>
</body>
</html>
4.2 category.html代码
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="referrer" content="origin">
<!-- TDK and ICO -->
<title>Tend to Code_一个使用django和bootstrap搭建的个人博客_TendCode</title> <meta name="description"
content="TendCode是一个Django搭建的博客,本网站后端使用Django框架搭建,前端使用Bootstrap框架,主要分享博主在Python以及其他编程语言的学习心得。">
<meta name="keywords" content="Python自学,Python爬虫,Django博客,Python web开发,个人博客">
<!--站长验证--> <link rel="shortcut icon" href="/static/blog/img/favicon.ico" type="image/x-icon"/>
<!-- Bootstrap and font-awesome CSS -->
<link href="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<script src="/static/js/headroom.min.js"></script>
<!-- blog CSS -->
<link href="/static/css/base.css" rel="stylesheet"> <!--根据cookies判断是否启用暗色主题--> </head>
<body>
<!--导航开始--> <nav class="navbar navbar-expand-md bg-white fixed-top blog-navbar py-md-0">
<a class="navbar-brand d-md-none d-lg-block" id="site-logo-name" href="/">
<strong class="px-2">TendCode</strong>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item mr-2"> <a class="nav-link py-md-3 active" href="/"><i class="fa fa-home mr-1"></i>首页<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item mr-2"> <a class="nav-link py-md-3 " href="./archive.html"><i class="fa fa-sitemap mr-1"></i>归档</a>
</li> <li class="nav-item mr-2"> <a class="nav-link py-md-3 " href="/tool/"><i class="fa fa-balance-scale mr-1"></i>在线工具</a>
</li> <li class="nav-item mr-2 d-none d-lg-block">
<a class="nav-link py-md-3" href="https://hao.tendcode.com" target="_blank"><i
class="fa fa-chrome mr-1"></i>微草导航</a>
</li> <li class="nav-item mr-2 "> <a class="nav-link py-md-3 " href="/about/"><i class="fa fa-anchor mr-1"></i>关于</a>
</li>
<form class="nav-item navbar-form mr-2 py-md-2" role="search" method="get" id="searchform"
action="/search/">
<div class="input-group">
<input type="search" name="q" class="form-control rounded-0" placeholder="站内搜索" autocomplete="off"
required=True>
<div class="input-group-btn">
<button class="btn btn-info rounded-0" type="submit"><i class="fa fa-search"></i></button>
</div>
</div><!-- /input-group -->
</form>
</ul>
<ul class="navbar-nav"> <li class="nav-item mr-2">
<a class="nav-link py-md-3" href="/accounts/login/?next=/">登录</a>
</li>
<li class="nav-item">
<a class="nav-link py-md-3" href="/accounts/signup/?next=/">注册</a>
</li> </ul>
</div>
</nav> <!--导航结束--> <!--消息块--> <!--回到顶部按钮-->
<div class="text-center" id="to-top">
<i class="fa fa-chevron-up" id="btn-top" title="回到顶部"></i>
</div> <!--主要内容块-->
<main>
<div class="container">
<div class="row">
<div class="col-lg-8">
<div class="description bg-white px-3 pt-3 pb-1">
<p class="float-right mb-0">共<span class="mx-2 text-info">{{ articles.count }}</span>篇</p>
<h1 class="f-17"><strong>文章分类:{{ articles.first.category.name }}</strong></h1>
<p class="f-16">CI/CD 是一种通过在应用开发阶段引入自动化来频繁向客户交付应用的方法。CI/CD 的核心概念是持续集成、持续交付和持续部署。具体而言,CI/CD 在整个应用生命周期内(从集成和测试阶段,到交付和部署)引入了持续自动化和持续监控。</p>
</div>
<div class="text-secondary font-weight-bold py-2 f-15 choice"> <a class="pb-2 active" href="/category/ci-cd/">
<i class="fa fa-bars mr-1"></i>时间排序</a> </div> <div class="summary-list">
{% for article in articles %}
<div class="media mb-1 mb-sm-2 p-2 p-lg-3">
<div class="align-self-center mr-2 mr-lg-3 w-25 modal-open">
<a href="article/Jenkins-Pipeline/" target="_blank">
<img class="w-100 article-img" src="https://tendcode.com/cdn/article/190710/jenkins.png" alt="【Jenkins 插件】Jenkins Pipeline 流水线插件的使用,Vue 项目自动化构建和部署实战">
</a>
</div>
<div class="media-body"> <div class="text-muted mb-2 f-12"> <img class="avatar" src="https://tendcode.com/media/avatar/2019/07/27/91ef76c6a7efce1b99717f97a851f3deb48f6510.png" alt="Hopetree"> <span>Hopetree</span>
<span><i class="fa fa-calendar-times-o ml-2 mr-1"></i>2月,3 周前</span>
</div>
<h2 class="mt-0 font-weight-bold text-info f-17">
<a href="/article/{{ article.id }}" target="_blank">{{ article.title }}</a>
</h2>
<p class="d-none d-sm-block mb-2 f-15">{{ article.content }}</p>
<div class="text-muted mb-0 f-12">
<a class="cate" href="/category/{{ article.category.id }}" title="查看当前分类下更多文章">
<i class="fa fa-book mr-1"></i>{{ article.category.name }}</a>
<span><i class="fa fa-eye ml-2 mr-1"></i>{{ article.read_count }}</span>
<a href="/article/Jenkins-Pipeline/#comment-block" target="_blank" title="查看文章评论">
<i class="fa fa-comments ml-2 mr-1"></i>5</a>
</div>
</div>
</div>
{% endfor %} </div> </div>
<div class="col-lg-4"> <!--个人空间-->
<div class="card border-0 rounded-0 px-3 mb-2 mb-md-3 d-none d-lg-block" id="home-card">
<div class="card-header bg-white px-0">
<strong><i class="fa fa-paper-plane mr-2 f-17"></i>个人空间</strong>
</div>
<div class="card-body px-0 pt-3 pb-1">
<div class="row text-center">
<div class="col">
<a href="https://github.com/Hopetree" target="_blank" title="进入博主的Github查看博客源码">
<img style="max-width:40px" alt="博主的github" src="https://tendcode.com/static/blog/img/github.png">
<p class="mt-2">Github</p>
</a>
</div>
<div class="col">
<a href="/timeline/" target="_blank" title="查看网站建站历程">
<img style="max-width:40px" alt="网站的建站历程" src="https://tendcode.com/static/blog/img/blog.png">
<p class="mt-2">Timeline</p>
</a>
</div> <div class="col">
<a href="/timeline/" target="_blank" title="查看网站建站历程">
<img style="max-width:40px" alt="网站的建站历程" src="https://tendcode.com/static/blog/img/blog.png">
<p class="mt-2">Timeline</p>
</a>
</div> </div>
</div>
</div> <!--文章分类-->
<div class="card border-0 rounded-0 px-3 mb-2 mb-md-3" id="category-card">
<div class="card-header bg-white px-0">
<strong><i class="fa fa-book mr-2 f-17"></i>文章分类</strong>
</div> <ul class="list-group list-group-flush f-16">
{% for category in categories %}
<li class="list-group-item d-flex justify-content-between align-items-center pr-2 py-2">
<a class="category-item" href="/category/ci-cd/" title="查看【CI/CD】分类下所有文章">{{ category.name }}</a>
<span class="badge text-center" title="当前分类下有6篇文章">{{ category.article_set.count }}</span>
</li>
{% endfor %} </ul>
</div>
<!--标签云-->
<div class="card border-0 rounded-0 px-3 mb-2 mb-md-3" id="tag-card">
<div class="card-header bg-white px-0">
<strong><i class="fa fa-tags mr-2 f-17"></i>标 签 云</strong>
</div>
<div class="card-body px-0 py-3">
<div class="tag-cloud"> <a href="/tag/Virtualenv/" class="tags f-16" id="tag-1" title="【Virtualenv】标签下有3篇文章">Virtualenv</a> <a href="/tag/Web-development/" class="tags f-16" id="tag-2" title="【后端开发】标签下有10篇文章">后端开发</a> <a href="/tag/python-crawler/" class="tags f-16" id="tag-3" title="【Python爬虫】标签下有8篇文章">Python爬虫</a> <a href="/tag/MD5/" class="tags f-16" id="tag-4" title="【MD5加密】标签下有2篇文章">MD5加密</a> <a href="/tag/Requests/" class="tags f-16" id="tag-5" title="【Requests】标签下有4篇文章">Requests</a> <a href="/tag/threading/" class="tags f-16" id="tag-6" title="【多线程】标签下有4篇文章">多线程</a> <a href="/tag/multiprocessing/" class="tags f-16" id="tag-7" title="【多进程】标签下有2篇文章">多进程</a> <a href="/tag/Django/" class="tags f-16" id="tag-8" title="【Django】标签下有10篇文章">Django</a> <a href="/tag/MySQL/" class="tags f-16" id="tag-9" title="【MySQL】标签下有4篇文章">MySQL</a> <a href="/tag/database/" class="tags f-16" id="tag-10" title="【数据库】标签下有2篇文章">数据库</a> <a href="/tag/Nginx/" class="tags f-16" id="tag-11" title="【Nginx】标签下有4篇文章">Nginx</a> <a href="/tag/Gunicorn/" class="tags f-16" id="tag-12" title="【Gunicorn】标签下有1篇文章">Gunicorn</a> <a href="/tag/Redis/" class="tags f-16" id="tag-13" title="【Redis】标签下有2篇文章">Redis</a> <a href="/tag/django-redis/" class="tags f-16" id="tag-14" title="【django-redis】标签下有1篇文章">django-redis</a> <a href="/tag/cache/" class="tags f-16" id="tag-15" title="【Cache】标签下有1篇文章">Cache</a> <a href="/tag/Linux/" class="tags f-16" id="tag-16" title="【Linux】标签下有8篇文章">Linux</a> <a href="/tag/crontab/" class="tags f-16" id="tag-17" title="【crontab】标签下有1篇文章">crontab</a> <a href="/tag/PhantomJS/" class="tags f-16" id="tag-18" title="【PhantomJS】标签下有1篇文章">PhantomJS</a> <a href="/tag/selenium/" class="tags f-16" id="tag-19" title="【Selenium】标签下有2篇文章">Selenium</a> <a href="/tag/queue/" class="tags f-16" id="tag-20" title="【Queue】标签下有1篇文章">Queue</a> <a href="/tag/configparser/" class="tags f-16" id="tag-21" title="【configparser】标签下有1篇文章">configparser</a> <a href="/tag/paramiko/" class="tags f-16" id="tag-22" title="【paramiko】标签下有1篇文章">paramiko</a> <a href="/tag/SSH/" class="tags f-16" id="tag-23" title="【SSH】标签下有3篇文章">SSH</a> <a href="/tag/shell/" class="tags f-16" id="tag-24" title="【shell】标签下有4篇文章">shell</a> <a href="/tag/Scrapy/" class="tags f-16" id="tag-25" title="【Scrapy】标签下有2篇文章">Scrapy</a> <a href="/tag/docker/" class="tags f-16" id="tag-26" title="【Docker】标签下有10篇文章">Docker</a> <a href="/tag/docker-compose/" class="tags f-16" id="tag-27" title="【docker-compose】标签下有5篇文章">docker-compose</a> <a href="/tag/docker-build/" class="tags f-16" id="tag-28" title="【容器化】标签下有8篇文章">容器化</a> <a href="/tag/centos/" class="tags f-16" id="tag-29" title="【CentOS】标签下有2篇文章">CentOS</a> <a href="/tag/pip/" class="tags f-16" id="tag-30" title="【pip】标签下有1篇文章">pip</a> <a href="/tag/argparse/" class="tags f-16" id="tag-31" title="【argparse】标签下有1篇文章">argparse</a> <a href="/tag/click/" class="tags f-16" id="tag-32" title="【Click】标签下有1篇文章">Click</a> <a href="/tag/OAuth2/" class="tags f-16" id="tag-33" title="【OAuth2.0】标签下有1篇文章">OAuth2.0</a> <a href="/tag/django-allauth/" class="tags f-16" id="tag-34" title="【django-allauth】标签下有1篇文章">django-allauth</a> <a href="/tag/git/" class="tags f-16" id="tag-35" title="【Git】标签下有2篇文章">Git</a> <a href="/tag/ci-cd/" class="tags f-16" id="tag-36" title="【CI/CD】标签下有6篇文章">CI/CD</a> <a href="/tag/Jenkins/" class="tags f-16" id="tag-37" title="【Jenkins】标签下有6篇文章">Jenkins</a> <a href="/tag/Vue/" class="tags f-16" id="tag-38" title="【Vue.js】标签下有3篇文章">Vue.js</a> <a href="/tag/ansible/" class="tags f-16" id="tag-39" title="【Ansible】标签下有1篇文章">Ansible</a> <a href="/tag/jinja2/" class="tags f-16" id="tag-40" title="【jinja2】标签下有1篇文章">jinja2</a> <a href="/tag/yaml/" class="tags f-16" id="tag-41" title="【YAML】标签下有1篇文章">YAML</a> </div>
</div>
</div>
<!--友链-->
<div class="d-none d-lg-block">
<div class="card border-0 rounded-0 px-3 mb-2 mb-md-3" id="friends-card">
<div class="card-header bg-white px-0">
<strong><i class="fa fa-link mr-2 f-17"></i>友情链接</strong>
</div>
<div class="card-body px-0 py-3">
<div class="tool-list"> <div class="w-50 float-left text-center mb-2">
<div class="mx-2">
<a href="https://github.com/Hopetree/izone" title="izone 博客项目的源代码" target="_blank">
博客源码</a>
</div>
</div> <div class="w-50 float-left text-center mb-2">
<div class="mx-2">
<a href="https://frostming.com" title="一个基于 Flask 开发的博客" target="_blank">
Frost's Blog</a>
</div>
</div> <div class="w-50 float-left text-center mb-2">
<div class="mx-2">
<a href="https://zmrenwu.com" title="Django 博客教程分享者" target="_blank">
追梦人物</a>
</div>
</div> <div class="w-50 float-left text-center mb-2">
<div class="mx-2">
<a href="https://www.dusaiphoto.com/" title="Django 搭建的博客,分享博客教程" target="_blank">
杜赛的个人网站</a>
</div>
</div> <div class="w-50 float-left text-center mb-2">
<div class="mx-2">
<a href="https://www.jerrycoding.com/" title="Jerry 的个人博客" target="_blank">
Jerry Coding</a>
</div>
</div> <div class="w-50 float-left text-center mb-2">
<div class="mx-2">
<a href="https://boywithacoin.cn/" title="Stray_Camel的个人技术博客" target="_blank">
Stray_Camel</a>
</div>
</div> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<!--js cookie 插件-->
<script src="/static/js/js.cookie.min.js?v=20191123.12"></script>
<script src="https://cdn.bootcss.com/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script>
$(function () {
var myElement = document.querySelector(".blog-navbar");
var headroom = new Headroom(myElement);
headroom.init()
});
</script>
<script src="/static/js/base.js?v=20191123.0909890"></script> <footer class="container-fluid mt-4 py-0">
<div class="card-body text-center px-0 f-14">
<p class="card-text mb-1">Copyright © <span id="year-info"></span>
Powered by Django.
</p> </div>
</footer>
</body>
</html>
4.3 detail.html代码
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="referrer" content="origin">
<!-- TDK and ICO -->
<title>Tend to Code_一个使用django和bootstrap搭建的个人博客_TendCode</title> <meta name="description"
content="TendCode是一个Django搭建的博客,本网站后端使用Django框架搭建,前端使用Bootstrap框架,主要分享博主在Python以及其他编程语言的学习心得。">
<meta name="keywords" content="Python自学,Python爬虫,Django博客,Python web开发,个人博客">
<!--站长验证--> <link rel="shortcut icon" href="/static/blog/img/favicon.ico" type="image/x-icon"/>
<!-- Bootstrap and font-awesome CSS -->
<link href="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<script src="/static/js/headroom.min.js"></script>
<!-- blog CSS -->
<link href="/static/css/base.css" rel="stylesheet">
<link href="/static/css/detail.css?v=20190918.07" rel="stylesheet">
<link href="/static/css/monokai.css?v=20190910.2" rel="stylesheet">
<link href="/static/css/base_comment.css?v=20190114.554" rel="stylesheet"> <!--根据cookies判断是否启用暗色主题--> </head>
<body>
<!--导航开始--> <nav class="navbar navbar-expand-md bg-white fixed-top blog-navbar py-md-0">
<a class="navbar-brand d-md-none d-lg-block" id="site-logo-name" href="/">
<strong class="px-2">TendCode</strong>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item mr-2"> <a class="nav-link py-md-3 active" href="/"><i class="fa fa-home mr-1"></i>首页<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item mr-2"> <a class="nav-link py-md-3 " href="./archive.html"><i class="fa fa-sitemap mr-1"></i>归档</a>
</li> <li class="nav-item mr-2"> <a class="nav-link py-md-3 " href="/tool/"><i class="fa fa-balance-scale mr-1"></i>在线工具</a>
</li> <li class="nav-item mr-2 d-none d-lg-block">
<a class="nav-link py-md-3" href="https://hao.tendcode.com" target="_blank"><i
class="fa fa-chrome mr-1"></i>微草导航</a>
</li> <li class="nav-item mr-2 "> <a class="nav-link py-md-3 " href="/about/"><i class="fa fa-anchor mr-1"></i>关于</a>
</li>
<form class="nav-item navbar-form mr-2 py-md-2" role="search" method="get" id="searchform"
action="/search/">
<div class="input-group">
<input type="search" name="q" class="form-control rounded-0" placeholder="站内搜索" autocomplete="off"
required=True>
<div class="input-group-btn">
<button class="btn btn-info rounded-0" type="submit"><i class="fa fa-search"></i></button>
</div>
</div><!-- /input-group -->
</form>
</ul>
<ul class="navbar-nav"> <li class="nav-item mr-2">
<a class="nav-link py-md-3" href="/accounts/login/?next=/">登录</a>
</li>
<li class="nav-item">
<a class="nav-link py-md-3" href="/accounts/signup/?next=/">注册</a>
</li> </ul>
</div>
</nav> <!--导航结束--> <!--消息块--> <!--回到顶部按钮-->
<div class="text-center" id="to-top">
<i class="fa fa-chevron-up" id="btn-top" title="回到顶部"></i>
</div> <!--主要内容块-->
<main>
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-9 col-xl-10">
<nav aria-label="breadcrumb">
<ol class="breadcrumb bg-white border-0 rounded-0 mb-2 py-2 f-15">
<li class="breadcrumb-item">
<i class="fa fa-home mr-1"></i><a href="/">首页</a>
</li>
<li class="breadcrumb-item">
<a href="/category/Python-Web-development/">{{ article.category.name }}</a>
</li>
<li class="breadcrumb-item active d-none d-md-block" aria-current="page">{{ article.title }}</li>
<li class="breadcrumb-item active d-md-none" aria-current="page">当前位置</li>
</ol>
</nav>
<div class="card rounded-0 border-0" id="article">
<div class="card-body px-2 px-md-3 pb-0">
<h1 class="card-title text-center font-weight-bold text-info">{{ article.title }}</h1>
<hr>
<div class="text-center f-13">
<span class="mx-2" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="最后编辑于2019年10月10日">{{ article.update_time }}</span>
<span class="mx-2">阅读 {{ article.read_count }}</span>
<a class="mx-2 to-com" href="#comment-block">评论 20</a>
</div>
<div class="article-body mt-4 f-17" style="line-height:1.8">
{{ article.content }}
<blockquote class="p-1 f-14" style="border-left: 4px solid #dc3545;">
<p class="m-1"><strong>版权声明:</strong>如无特殊说明,文章均为本站原创,转载请注明出处</p>
<p class="m-1"><strong>本文链接:</strong>https://tendcode.com/article/django2/</p>
</blockquote>
</div>
<div class="tag-cloud my-4"> <a class="tags f-16" href="/tag/Web-development/">后端开发</a> <a class="tags f-16" href="/tag/Django/">Django</a> </div>
<nav class="more-page f-16">
<ul class="pagination justify-content-between">
<li class="page-item"> <a class="d-none d-md-block" href="/article/ansible-and-docker/" title="上一篇:使用 Ansible 工具批量操作虚拟机集群,自动化安装 Docker">
<i class="fa fa-chevron-left mr-1"></i>
使用 Ansible 工具批量操作虚
</a>
<a class="d-md-none" href="/article/ansible-and-docker/">
<i class="fa fa-chevron-left mr-1"></i>上一篇</a> </li>
<li class="page-item"> <a class="d-none d-md-block" href="/article/python-shell-cmd/" title="下一篇:使用 python 执行 shell 命令的几种常用方式">
使用 python 执行 shell
<i class="fa fa-chevron-right ml-1"></i>
</a>
<a class="d-md-none" href="/article/python-shell-cmd/">
下一篇<i class="fa fa-chevron-right ml-1"></i>
</a> </li>
</ul>
</nav> <div class="text-center">
<button class="btn btn-danger rounded-0" data-toggle="collapse" data-target=".multi-collapse" aria-expanded="false" aria-controls="sponsor-zfb sponsor-wx" style="line-height: 1;font-size: .8rem;">
<i class="fa fa-cny"></i>
如果文章对你有所帮助,可以赞助本站
<i class="fa fa-chevron-down"></i>
</button>
</div>
<div class="row p-3">
<div class="col text-center">
<div class="collapse multi-collapse" id="sponsor-wx">
<div class="p-1 text-success">微信</div>
<img class="w-75" src="/static/blog/img/reward_wx.png">
</div>
</div>
<div class="col text-center">
<div class="collapse multi-collapse" id="sponsor-zfb">
<div class="p-1 text-primary">支付宝</div>
<img class="w-75" src="/static/blog/img/reward_zfb.png">
</div>
</div>
</div>
</div> </div> </div>
</div>
</div>
<!--图片预览-->
<div class="modal fade" id="img-to-big" tabindex="-1" role="dialog" aria-labelledby="img-to-bigTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document" style="max-width: 90%">
<img class="rounded mx-auto d-block" alt="image" style="max-width: 100%">
</div>
</div>
<!--前后文章--> <div class="more-blog" id="icon-pre-blog">
<a href="/article/ansible-and-docker/">
<i class="fa fa-angle-left fa-3x"></i>
</a>
</div> <div class="more-blog" id="icon-next-blog">
<a href="/article/python-shell-cmd/">
<i class="fa fa-angle-right fa-3x"></i>
</a>
</div> </main>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<!--js cookie 插件-->
<script src="/static/js/js.cookie.min.js?v=20191123.12"></script>
<script src="https://cdn.bootcss.com/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://cdn.bootcss.com/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script>
$(function () {
var myElement = document.querySelector(".blog-navbar");
var headroom = new Headroom(myElement);
headroom.init()
});
</script>
<script src="/static/js/base.js?v=20191123.0909890"></script> <footer class="container-fluid mt-4 py-0">
<div class="card-body text-center px-0 f-14">
<p class="card-text mb-1">Copyright © <span id="year-info"></span>
Powered by Django.
</p> </div>
</footer>
</body>
</html>
Django基础-04篇 Django开发前后端联动的更多相关文章
-
day 69 Django基础五之django模型层(一)单表操作
Django基础五之django模型层(一)单表操作 本节目录 一 ORM简介 二 单表操作 三 章节作业 四 xxx 一 ORM简介 MVC或者MVC框架中包括一个重要的部分,就是ORM,它实现 ...
-
day 55 Django基础五之django模型层(一)单表操作
Django基础五之django模型层(一)单表操作 本节目录 一 ORM简介 二 单表操作 三 章节作业 四 xxx 一 ORM简介 MVC或者MVC框架中包括一个重要的部分,就是ORM,它 ...
-
day 70 Django基础五之django模型层(二)多表操作
Django基础五之django模型层(二)多表操作 本节目录 一 创建模型 二 添加表记录 三 基于对象的跨表查询 四 基于双下划线的跨表查询 五 聚合查询.分组查询.F查询和Q查询 六 ORM ...
-
day 56 Django基础五之django模型层(二)多表操作
Django基础五之django模型层(二)多表操作 本节目录 一 创建模型 二 添加表记录 三 基于对象的跨表查询 四 基于双下划线的跨表查询 五 聚合查询.分组查询.F查询和Q查询 六 ORM ...
-
day 57 Django基础五之django模型层之关联管理器
Django基础五之django模型层之关联管理器 class RelatedManager "关联管理器"是在一对多或者多对多的关联上下文中使用的管理器.它存在于下面两种情况 ...
-
研发流程 接口定义&;开发&;前后端联调 线上日志观察 模型变动
阿里等大厂的研发流程,进去前先了解一下_我们一起进大厂 - SegmentFault 思否 https://segmentfault.com/a/1190000021831640 接口定义 测试用例评 ...
-
Django 基础05篇 上下文管理和前端代码复用
一.上下文管理器 在views中重复使用的代码,可以通过上下文管理器(在setting.py文件中的TEMPLATES中配置)中实现,减少代码冗余 上下文管理器的处理流程如下: 1.先走完views里 ...
-
Django基础第一篇
目录 1.Django MTV框架简介 2.基础命令创建项目的配置说明 3.前后端交互案例 4.基于数据库实现数据交互增删改查 Django简介 Django框架的设计模式借鉴了MVC的思想,和MVC ...
-
Django基础-01篇
一.Django介绍 flask,FastApi是轻量级服务端开发框架 Django是重量级服务端开发框架 ORM:封装了数据库操作 form:校验请求数据 安装Django: pip install ...
随机推荐
-
PDF 补丁丁 0.5.0.2731 发布(增加去除页面表单和链接水印功能)
新的版本增加了简单的删除表单和链接批注的功能,使用该功能可去掉某些软件打上的水印. 在 PDF 文档选项中选中“清除页面所有表单”和“清除页面所有链接批注”项后,程序将会删除页面的表单和链接批注. 效 ...
-
Android图片浏览器之缩略图
项目源码:http://files.cnblogs.com/files/tgyf/app.rar. 最近在自学Android,尝试实现一般手机上都存在的图片浏览器,从缩略图开始. 直接上图,这是goo ...
-
Java Base64编码解码实现
我尝试过两种方式:java自带的sun.misc的工具类,还有commons-codec.jar 1.sun.misc的工具类 String encoderStr = null; BASE64Enco ...
-
About Closure
Closure被翻译为闭包,C++11引入了Lambda表达式支持Closure,JavaScript支持Closure,Objective C支持Blocks,他们都是Closure,名字各有不同, ...
-
5 给我们的c#程序添加注释
注释是你的程序中的一个重要部分.在程序中添加注释是用来告诉你和其他人你的程序是做什么用的,你的思路是怎样的.注释可以用你熟悉的中文进行添加. 当你想暂时把你程序中的某些语句去掉的时候,不需要把他们删除 ...
-
BZOJ 4004: [JLOI2015]装备购买 [高斯消元同余 线性基]
和前两(一)题一样,不过不是异或方程组了..... 然后bzoj的新数据是用来卡精度的吧..... 所有只好在模意义下做啦 只是巨慢无比 #include <iostream> #incl ...
-
spring4笔记----常见的java的字符类型与xml匹配
private List<String> schools; <property name="schools"> <list> <value ...
-
pytorch实现花朵数据集读取
import os from PIL import Image from torch.utils import data import numpy as np from torchvision imp ...
-
ALGO-22_蓝桥杯_算法训练_装箱问题(DP)
问题描述 有一个箱子容量为V(正整数,<=V<=),同时有n个物品(<n<=),每个物品有一个体积(正整数). 要求n个物品中,任取若干个装入箱内,使箱子的剩余空间为最小. 输 ...
-
Oracle 命令
net start oracleserviceorcl 启动服务 sql>shutdown 关闭数据库 sql>startup 打开数据库 sql> sel ...