会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Tmars
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
下一页
2024年10月5日
项目部署二:服务器和环境配置
摘要: 2.服务和环境配置 下面的配置和操作均在腾讯云服务器+CentOS 7.5的系统下进行。 2.1 MySQL 安装服务端 yum install mariadb-server -y mariadb-server.x86_64 1:5.5.68-1.el7 安装客户端 yum install mari
阅读全文
posted @ 2024-10-05 20:33 tmars
阅读(156)
评论(0)
推荐(0)
2024年9月30日
项目部署一:前期准备(本地上传、gitignore、ssh连接、密钥)
摘要: 项目部署 想要将django项目部署在服务器上,本质上需要三大部分: 将代码上传到服务器 在服务器上 获取代码、安装服务、配置环境 启动服务 1.代码同步 上传代码的方式有很多种,例如:FTP工具、scp命令、rsync服务、svn等,不过目前公司主流的都是使用git+代码托管平台。 本地电脑,安装
阅读全文
posted @ 2024-09-30 17:20 tmars
阅读(51)
评论(0)
推荐(0)
Gitee简单操作
摘要: gitee上传代码 第一步:电脑上先安装git: 下载链接 https://git-scm.com/downloads # 如果在桌面鼠标右键,出现下面两个东西,则安装成功 open Git GUI here open Git Bash here 第二步:注册gitee/github 第三步:创建项
阅读全文
posted @ 2024-09-30 16:55 tmars
阅读(95)
评论(0)
推荐(0)
2024年9月10日
第四章 视图(views)
摘要: 4.视图 4.1 文件or文件夹 4.2 相对和绝对导入urls 注意实现:不要再项目根目录做相对导入。 原则: 绝对导入 相对导入(层级深) 4.3 视图参数 urlpatterns = [ path('login/', account.login, name="login"), path('au
阅读全文
posted @ 2024-09-10 19:32 tmars
阅读(59)
评论(0)
推荐(0)
2024年9月6日
第三章 路由系统
摘要: 3.路由系统 本质上:URL和函数的对应关系。 3.1 传统的路由 from django.contrib import admin from django.urls import path from apps.web import views urlpatterns = [ path('home/
阅读全文
posted @ 2024-09-06 09:21 tmars
阅读(25)
评论(0)
推荐(0)
2024年9月3日
第二章 快速上手Django框架
摘要: 1.终端安装 pip install django==3.2 C:\Python39 - python.exe - Scripts - pip.exe - django-admin.exe - Lib - re.py - random.py - site-pakages - django==3.2
阅读全文
posted @ 2024-09-03 20:26 tmars
阅读(27)
评论(0)
推荐(0)
第一章 Django基础与虚拟环境
摘要: 1.Web框架和Django框架 1.1网络通信 注意:局域网 个人一般写程序,想要让别人访问:阿里云、腾讯云。 去云平台租服务器(含公网IP) 程序放在云服务器 让网络中可以互相通信的双发收发数据。 服务端【我的电脑】 import socket # 1.监听本机的IP和端口 sock = soc
阅读全文
posted @ 2024-09-03 19:34 tmars
阅读(26)
评论(0)
推荐(0)
2024年8月27日
实战案例四:异步实现爬虫
摘要: 爬虫 pip3 install aiohttp import aiohttp import asyncio async def fetch(session, url): print("发送请求:", url) async with session.get(url, verify_ssl=False)
阅读全文
posted @ 2024-08-27 21:15 tmars
阅读(31)
评论(0)
推荐(0)
实战案例三:异步操作FastAPI
摘要: FastAPI框架 安装 pip3 install fastapi pip3 install uvicorn (asgi内部基于uvloop) 示例: luffy.py #!/usr/bin/env python # -*- coding:utf-8 -*- import asyncio impor
阅读全文
posted @ 2024-08-27 21:14 tmars
阅读(97)
评论(0)
推荐(0)
实战案例二:异步操作MySQL
摘要: 异步MySQL pip3 install aiomysql 示例1: import asyncio import aiomysql async def execute(): # 网络IO操作:连接MySQL conn = await aiomysql.connect(host='127.0.0.1'
阅读全文
posted @ 2024-08-27 21:13 tmars
阅读(56)
评论(0)
推荐(0)
上一页
1
2
3
4
5
下一页
公告