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

宠物网站推广怎么做网址创建

宠物网站推广怎么做,网址创建,今日新闻热点,谷歌云做网站大家好,我是java1234_小锋老师,看到一个不错的基于Python的Django博客系统,分享下哈。 项目视频演示 【免费】基于Python的Django博客系统 Python毕业设计_哔哩哔哩_bilibili 项目介绍 随着互联网技术的飞速发展,信息的传播与…

大家好,我是java1234_小锋老师,看到一个不错的基于Python的Django博客系统,分享下哈。

项目视频演示

【免费】基于Python的Django博客系统 Python毕业设计_哔哩哔哩_bilibili

项目介绍

随着互联网技术的飞速发展,信息的传播与分享变得更加高效与便捷。博客作为一种自媒体形式,不仅为个人提供了表达思想、展示创作的平台,也为企业和机构的网络营销、品牌传播等提供了重要的载体。近年来,博客系统逐渐发展成为内容管理系统(CMS)中的一种重要应用形式,其在网站开发、用户管理、内容呈现等方面的需求日益增长。因此,如何开发一个高效、可维护且具备扩展性的博客系统,成为了许多开发者关注的热点。

在现代Web开发中,Python作为一种简洁且功能强大的编程语言,凭借其丰富的库和框架,逐渐成为开发Web应用程序的首选语言。其中,Django框架以其高效、稳定的特性,广泛应用于Web开发领域。Django框架通过“约定优于配置”的理念,帮助开发者快速构建起具有良好架构和高可维护性的Web应用。它集成了数据库模型、URL路由、视图逻辑等模块,使得开发者能够专注于业务逻辑的实现,而无需为基础设施的搭建而操心。

在开发Django博客系统时,数据存储是不可忽视的关键部分。MySQL作为一种开源的关系型数据库管理系统,凭借其高效的数据存储和查询能力,已经成为Web开发中广泛使用的数据库之一。MySQL具有良好的扩展性、事务管理、以及高并发处理能力,非常适合用作中大型Web应用的数据库系统。

本论文旨在基于Python的Django框架开发一个简单而功能全面的博客系统,并利用MySQL数据库进行数据存储。该系统旨在提供博客发布、评论互动、用户管理等基本功能,同时具有良好的用户体验与后台管理能力。在实现过程中,论文将详细探讨Django框架的使用、数据库设计与优化、前后端交互、以及系统的安全性等问题。通过此系统的开发与实现,本文希望展示Django与MySQL在Web应用开发中的优势,并为开发者在构建类似系统时提供参考与借鉴。

随着博客系统的不断发展与变化,如何构建一个高效、安全、可维护的博客平台,成为了一个亟待解决的问题。通过结合Python的Django框架与MySQL数据库,本文将探讨如何高效地设计并实现一个符合现代互联网应用需求的博客系统。

系统展示

部分代码

import datetimefrom django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.db.models import F, Q
from django.shortcuts import render, redirect
from django.urls import reversefrom article.models import Article, Comment
from user.models import MyUser# Create your views here.def article(request, id, page, typeId):"""根据用户id和页码查询帖子:param request::param id::param page::param typeId: 0表示查询全部:return:"""pageSize = 10  # 每页大小user = MyUser.objects.filter(id=id).first()if not user:return redirect(reverse('toRegisterPage'))if typeId == None or typeId == 0:articleList = Article.objects.filter(author_id=id).order_by('-create_time')else:articleList = Article.objects.filter(author_id=id, type_id=typeId).order_by('-create_time')paginator = Paginator(articleList, pageSize)try:pageData = paginator.page(page)  # 获取一页数据except PageNotAnInteger:pageData = paginator.page(1)  # 如果前端传来的页码不是整型,则返回第一页数据except EmptyPage:pageData = paginator.page(paginator.num_pages)  # 如果前端传来的页码超过实际页数,则返回最后一页数据return render(request, 'article.html', locals())def detail(request, id, aId):"""根据用户id和帖子id查看详细信息 & 添加评论信息:param request::param id::param aId::return:"""if request.method == 'GET':  # 查询帖子信息user = MyUser.objects.filter(id=id).first()article = Article.objects.filter(id=aId).first()# 阅读量加1Article.objects.filter(id=aId).update(reads=F('reads') + 1)# 获取博客评论信息commentList = Comment.objects.filter(article_id=aId).order_by('-create_time')return render(request, 'detail.html', locals())else:  # 添加评论信息user = request.POST.get("user")content = request.POST.get("content")value = {'user': user, 'content': content, 'article_id': aId, 'create_time': datetime.datetime.now(),'author_id': id}Comment.objects.create(**value)kwargs = {'id': id, 'aId': aId}return redirect(reverse('detail', kwargs=kwargs))def search(request, id):"""根据搜索条件搜索指定用户帖子,只显示前10条记录:param request::param id::param v::return:"""v = request.POST.get("v")articleList = Article.objects.filter(Q(author_id=id, title__contains=v) | Q(author_id=id, content__contains=v))paginator = Paginator(articleList, 10)pageData = paginator.page(1)return render(request, 'result.html', locals())
<!DOCTYPE html>
<html lang="en">
<head>{% load static %}<title>博客系统用户登录界面-Powered by python222</title><script src="{% static "js/jquery-1.11.2.min.js" %}"></script><link rel="stylesheet" href="{% static "css/login.css" %}" type="text/css"><script type="text/javascript">$(function () {//得到焦点$("#password").focus(function () {$("#left_hand").animate({left: "150",top: " -38"}, {step: function () {if (parseInt($("#left_hand").css("left")) > 140) {$("#left_hand").attr("class", "left_hand");}}}, 2000);$("#right_hand").animate({right: "-64",top: "-38px"}, {step: function () {if (parseInt($("#right_hand").css("right")) > -70) {$("#right_hand").attr("class", "right_hand");}}}, 2000);});//失去焦点$("#password").blur(function () {$("#left_hand").attr("class", "initial_left_hand");$("#left_hand").attr("style", "left:100px;top:-12px;");$("#right_hand").attr("class", "initial_right_hand");$("#right_hand").attr("style", "right:-112px;top:-12px");});});function checkForm() {var username = $("#username").val();var password = $("#password").val();if (username == null || username == "") {$("#error").html("用户名不能为空!");return false;}if (password == null || password == "") {$("#error").html("密码不能为空!");return false;}return true;}</script>
</head>
<body>
<DIV class="top_div">
</DIV>
<form action="login" method="post" onsubmit="return checkForm()">{% csrf_token %}<DIV style="background: rgb(255, 255, 255); margin: -100px auto auto; border: 1px solid rgb(231, 231, 231); border-image: none; width: 400px; height: 230px; text-align: center;"><DIV style="width: 165px; height: 96px; position: absolute;"><DIV class="tou"></DIV><DIV class="initial_left_hand" id="left_hand"></DIV><DIV class="initial_right_hand" id="right_hand"></DIV></DIV><P style="padding: 30px 0px 10px; position: relative;"><SPAN class="u_logo"></SPAN><INPUT id="username" name="username" class="ipt" type="text" placeholder="请输入用户名"value="{{ username }}"></P><P style="position: relative;"><SPAN class="p_logo"></SPAN><INPUT id="password" name="password" class="ipt" type="password" placeholder="请输入密码"value="{{ password }}"></P><DIV style="height: 50px; line-height: 50px; margin-top: 30px; border-top-color: rgb(231, 231, 231); border-top-width: 1px; border-top-style: solid;"><P style="margin: 0px 35px 20px 45px;"><SPAN style="float: left;">Python222开源博客系统&nbsp;&nbsp;&nbsp;&nbsp;<a href="register.html"style="color: darkcyan">>>用户注册</a></SPAN><SPAN style="float: right;"><input type="submit"style="background: rgb(0, 142, 173); padding: 7px 10px; border-radius: 4px; border: 1px solid rgb(26, 117, 152); border-image: none; color: rgb(255, 255, 255); font-weight: bold;"value="登录"/></SPAN></P></DIV><span style="padding-top: 5px"><font color="red" id="error">{{ errorinfo }}</font></span></DIV>
</form>
<div style="text-align:center;padding-top: 30px"></div>
</body>
</html>

源码代码

链接:https://pan.baidu.com/s/1zz7oqInJcMZeZ6e_pAaEvA
提取码:1234

http://www.hkea.cn/news/546105/

相关文章:

  • 有哪些做批发的网站有哪些手续百度推广优化是什么意思
  • 用阿里巴巴店铺做公司网站怎么样引擎搜索有哪些
  • 网页制作软件属于什么软件类别简述seo的优化流程
  • 网站建设 公司新闻谷歌排名网站优化
  • 怎样做自己的vip解析网站佛山外贸seo
  • 我的网站在百度搜不到了seo是什么职业做什么的
  • 网站私信界面国外网站seo免费
  • wordpress mysql类惠州网站seo
  • 为什么做网站必须要用域名举出最新的网络营销的案例
  • 电子请柬网站开发百度竞价推广登录入口
  • 网站设计与推广国际时事新闻2022最新
  • 柬埔寨网站开发营销技巧和营销方法
  • 网站建立价格长沙网站外包公司
  • 王建设医生个人网站免费google账号注册入口
  • 免费自建手机网站搜索引擎优化的方法包括
  • 甘肃省建设工程安全质量监督管理局网站官网拉新项目官方一手平台
  • 做电影网站赚钱武汉新闻最新消息
  • 做网站没有成本的方法上海百度分公司电话
  • 寺庙网站建设百度ai人工智能
  • 完成公司网站建设下载关键词推广软件
  • wordpress如何关闭网站下载app
  • WordPress小程序二次修改石家庄seo排名外包
  • 做百度关键词网站厦门seo外包
  • 泉州seo-泉州网站建设公司谷歌关键词搜索工具
  • 组织部网站建设方案行业关键词分类
  • 上海黄浦 网站制作中国搜索引擎排名2021
  • 手机网站建设 cms营销技巧和营销方法
  • 平顶山做网站优化微博搜索引擎优化
  • 网站如何做品牌宣传海报每日舆情信息报送
  • 做论坛网站需要多大空间seo推广招聘