{"id":20993098,"url":"https://github.com/haozhang95/dailyfresh","last_synced_at":"2025-04-13T08:39:50.435Z","repository":{"id":37062311,"uuid":"185847725","full_name":"HaoZhang95/dailyfresh","owner":"HaoZhang95","description":"天天生鲜是传智播客黑马出品的python实战项目， 项目的[在线视频教程], 项目的讲义被放在了Python24期整套视频的讲义中的**第20章节**，具体的天天生鲜 [在线讲义查看]，除了天天生鲜项目之外，传智播客\u0026黑马出品的Python24期人工智能整套代码和讲义集合，项目从零基础的Python教程到深度学习，总共30章节，其中包含Python基础中的飞机大战项目，WSGI项目，Flask新经资讯项目， Django的电商项目(本应该的美多商城项目因为使用的是Vue技术，所以替换为Django天天生鲜项目)等等，请[点击此处查看](https://github.com/HaoZhang95/Python24)","archived":false,"fork":false,"pushed_at":"2022-12-08T05:08:12.000Z","size":4094,"stargazers_count":214,"open_issues_count":10,"forks_count":65,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-27T00:13:21.413Z","etag":null,"topics":["dailyfresh","django","itcast","python","web"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HaoZhang95.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-09T17:58:25.000Z","updated_at":"2025-03-09T12:45:32.000Z","dependencies_parsed_at":"2023-01-24T12:00:12.591Z","dependency_job_id":null,"html_url":"https://github.com/HaoZhang95/dailyfresh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaoZhang95%2Fdailyfresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaoZhang95%2Fdailyfresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaoZhang95%2Fdailyfresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaoZhang95%2Fdailyfresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HaoZhang95","download_url":"https://codeload.github.com/HaoZhang95/dailyfresh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248685353,"owners_count":21145269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dailyfresh","django","itcast","python","web"],"created_at":"2024-11-19T07:13:43.354Z","updated_at":"2025-04-13T08:39:50.392Z","avatar_url":"https://github.com/HaoZhang95.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dailyfresh-天天生鲜\n天天生鲜是传智播客黑马出品的python实战项目，\n项目的[在线视频教程](https://www.bilibili.com/video/av41733850/?p=49), 项目的讲义被放在了Python24期整套视频的讲义中的**第20章节**，具体的天天生鲜\n[在线讲义查看](https://haozhang95.github.io/Python24/)，除了天天生鲜项目之外，传智播客\u0026黑马出品的Python24期人工智能整套代码和讲义集合，项目从零基础的Python教程到深度学习，总共30章节，其中包含Python基础中的飞机大战项目，WSGI项目，Flask新经资讯项目， Django的电商项目(本应该的美多商城项目因为使用的是Vue技术，所以替换为Django天天生鲜项目)等等，请[点击此处查看](https://github.com/HaoZhang95/Python24)\n\u003e B2C(Business-to-Customer), 企业对个人的一种商业模式，简称\"商对客\". 商对客是电子商务的一种模式，这种电子商务一般以网络零售业为主，主要借助于互联网开展在线销售活动。 B2C即企业通过互联网为消费者提供一个新型的购物环境——网上商店，消费者通过网络在网上购物、网上支付等消费行为。\n\n为消费者提供一个新型的购物环境:   \n从0开始，立项、构建、开发到部署, 搭建一个天天生鲜商场\n\n#### 技术栈\n- 语言：Python3.* (Django)   \n- 数据库: MySql、 redis  \n- 任务队列(异步处理): celery(django-celery)     \n- 分布式文件存储: FastDFS   \n- 搜索引擎(商品检索)：  haystack(django-haystack)、whoosh、二次开发    \n- web服务器配置: Nginx+ uwsgi    \n- 开发环境： PyCharm、Linux、vim   \n\n\n#### 技术架构\n* 开发架构    \n采用BS结构, 即Browser/Server(浏览器/服务器)结构,构建一个web的网站商城系统, 其架构逻辑:   \n![frame](Readme/framework.png)\n\n* 部署架构     \nNginx+uwsgi     \n![deploy](Readme/deploy.PNG)\n\n\n####  主体模块  \n主要分为四个大模块:    \n* 用户模块、    \n* 商品相关模块、    \n* 购物车相关模块、   \n* 订单相关模块、    \n[查看各模块详情分析](Readme/Analysis.md)\n\n\n####  数据库表\n![DB](Readme/DBtables.png)\n* SPU是商品信息聚合的最小单位，是一组可复用、易检索的标准化信息的集合，该集合描述了一个产品的特性。通俗点讲，属性值、特性相同的商品就可以称为一个SPU。     \n例如，iphone4就是一个SPU，N97也是一个SPU，这个与商家无关，与颜色、款式、套餐也无关。\n* SKU即库存进出计量的单位， 可以是以件、盒、托盘等为单位，在服装、鞋类商品中使用最多最普遍。   \n例如纺织品中一个SKU通常表示：规格、颜色、款式。        \n    \n    \n#### 功能模块展示      \n[点击查看--多图预警](Readme/show.md)\n    \n   \n#### 功能与性能优化\n1. 用户注册发激活邮件时，可能发送邮件所需的时间较长，客户端会需要等待，用户体验不好。     \n \u003e  改进: 把耗时的任务放到后台异步执行，此处使用celery任务队列, 其中使用redis作中间件。  \n2. redis存储用户历史浏览记录, 采用list数据结构: History_用户id: [skuid1,skuid2,skuid3]\n3. 使用redis存储用户购物车商品信息，采用hash数据结构: cart_userid: {'sku_id1': num, 'sku_id2': num}    \n4. 采用分布式文件系统， 把商品图片等信息存储在FastDFS系统中, Nginx+FastDFS配合, 减少服务器的压力。         \n5. 页面静态化： 首页、商品列表页、商品详情页等用户共同的页面, 把页面静态化，以减少对数据库的操作。当后台数据更改时自动重新生成静态页。  \n6. 页面数据缓存，把页面使用的数据存放在缓存中，当再次使用这些数据时，先从缓存中获取，如获取不到，再去查询数据库，减少数据库的查询次数。  \n7. 订单并发\n\n\n### Links    \n\n[Fastdfs在Centos安装教程(一)](https://www.codetd.com/article/1815445)\n\n[Fastdfs在Centos安装教程(二)](https://blog.csdn.net/MissEel/article/details/80859865)\n\n* 在进行教程(2d的过程中如果遇到下列错误的解决方法 /usr/include/fastdfs/fdfs_define.h:15:27: fatal error: common_define.h: No such file or directory\n暴力直接的方法就是 把 /usr/include/fastcommon 下面的文件，复制一份到 /usr/include/fastdfs 再进行编译\n  \n  \n* Libfastcommon: 安装FastDFS之前要先安装它的依赖库libfastcommon    \n[https://github.com/happyfish100/libfastcommon/releases](https://github.com/happyfish100/libfastcommon/releases)   \n* FastDFS   \n[https://github.com/happyfish100/FastDFS](https://github.com/happyfish100/FastDFS)\n* Nginx    \n[https://nginx.org/download/](https://nginx.org/download/)    \n* fastdfs-nginx-module   \n[https://github.com/happyfish100/fastdfs-nginx-module/releases](https://github.com/happyfish100/fastdfs-nginx-module/releases)   \n* 支付宝api    \n[https://open.alipay.com/platform/home.htm](https://open.alipay.com/platform/home.htm)    \n* celery   \n[http://docs.jinkan.org/docs/celery/](http://docs.jinkan.org/docs/celery/)   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaozhang95%2Fdailyfresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaozhang95%2Fdailyfresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaozhang95%2Fdailyfresh/lists"}