Pad0y / Django2_dailyfresh
Licence: mit
dailyfresh电商项目,替换django框架为2.X并重构,美化了下后台管理页面,提供docker版本,该项目包含了实际开发中的电商项目中大部分的功能开发和知识点实践, 是一个非常不错的django学习项目,同时也记录在替换框架中遇到的坑,希望对各位的学习有所帮助。
Stars: ✭ 212
Projects that are alternatives of or similar to Django2 dailyfresh
Docker Django
A complete docker package for deploying django which is easy to understand and deploy anywhere.
Stars: ✭ 378 (+78.3%)
Mutual labels: redis, celery, nginx
Kickoff Docker Php
🐳 🐘 🚀 Easily setup a PHP project with Docker
Stars: ✭ 213 (+0.47%)
Mutual labels: redis, nginx
Fastapi Celery
Minimal example utilizing fastapi and celery with RabbitMQ for task queue, Redis for celery backend and flower for monitoring the celery tasks.
Stars: ✭ 154 (-27.36%)
Mutual labels: redis, celery
Study
全栈工程师学习笔记;Spring登录、shiro登录、CAS单点登录和Spring boot oauth2单点登录;Spring data cache 缓存,支持Redis和EHcahce; web安全,常见web安全漏洞以及解决思路;常规组件,比如redis、mq等;quartz定时任务,支持持久化数据库,动态维护启动暂停关闭;docker基本用法,常用image镜像使用,Docker-MySQL、docker-Postgres、Docker-nginx、Docker-nexus、Docker-Redis、Docker-RabbitMQ、Docker-zookeeper、Docker-es、Docker-zipkin、Docker-ELK等;mybatis实践、spring实践、spring boot实践等常用集成;基于redis的分布式锁;基于shared-jdbc的分库分表,支持原生jdbc和Spring Boot Mybatis
Stars: ✭ 159 (-25%)
Mutual labels: redis, nginx
Django Celery Docker Example
Example Docker setup for a Django app behind an Nginx proxy with Celery workers
Stars: ✭ 149 (-29.72%)
Mutual labels: celery, nginx
Nginx
NGINX Accelerated! This is a Docker image that creates a high performance (FAST!), optimized image for NGINX for use with Redis and PHP-FMP. Deliver sites and applications with performance, reliability, security, and scale. This NGINX server offers advanced performance, web and mobile acceleration, security controls, application monitoring, and management.
Stars: ✭ 157 (-25.94%)
Mutual labels: redis, nginx
Vagrant Elastic Stack
Giving the Elastic Stack a try in Vagrant
Stars: ✭ 131 (-38.21%)
Mutual labels: redis, nginx
Docker Flask Celery Redis
Docker-Compose template for orchestrating a Flask app with a Celery queue using Redis
Stars: ✭ 165 (-22.17%)
Mutual labels: redis, celery
Nginx Helper
Nginx Helper for WordPress caching, permalinks & efficient file handling in multisite
Stars: ✭ 170 (-19.81%)
Mutual labels: redis, nginx
Lovinghome Real Estate Platform
⚡️基于springboot+MyBatis+FreeMarker+redis+nginx+Echarts+druid等技术的JavaWeb项目------恋家房产平台(采用B/S架构,项目包含前后台,分为前台展示系统及后台管理系统。前台系统包含首页门户、登录注册、房产推荐、房产详情、热门房产、房产及小区搜索、经纪人列表及经纪机构创建、创建房产、房产百科、地图找房、用户个人中心、房产评论、房产打分等模块。 后台管理系统包含房产信息管理、用户管理、管理员管理、小区信息管理、博客管理、评论管理、经纪人管理、系统统计与多种图表展示、数据报表导入导出等模块。系统介绍及详细功能点、技术点见项目内文档描述)
Stars: ✭ 140 (-33.96%)
Mutual labels: redis, nginx
Django School Management
Deployment Ready Developer to Developer Full-stack School Management System with payments, e-admission, result management, academic functionalities, and much more implemented in a simple way.
Stars: ✭ 151 (-28.77%)
Mutual labels: redis, celery
Oneinstack
OneinStack - A PHP/JAVA Deployment Tool
Stars: ✭ 1,983 (+835.38%)
Mutual labels: redis, nginx
Seconds Kill
基于 Springboot + Redis + Kafka 的秒杀系统,乐观锁 + 缓存 + 限流 + 异步,TPS 从 500 优化到 3000
Stars: ✭ 180 (-15.09%)
Mutual labels: redis, nginx
Light Push
轻量级推送服务和实时在线监控平台,同时用于开发即时通信系统,基于node的socket.io,支持web、android、ios客户端,支持移动端离线推送,可进行分布式部署
Stars: ✭ 128 (-39.62%)
Mutual labels: redis, nginx
Roomler
Roomler - Multi-party Video Conferencing & Team Collaboration Tool using WebRTC (Janus Gateway)
Stars: ✭ 160 (-24.53%)
Mutual labels: redis, nginx
天天生鲜-django2.2版本
简介
本项目替换原项目框架django1.8为最新版的django2.2.5(已修复为2.2.10),该项目包含了实际开发中的电商项目中大部分的功能开发和知识点实践, 是一个非常不错的django学习项目,同时也记录在替换框架中遇到的坑,所遇到的django1.x和2.x的区别,希望对各位的学习有所帮助。
关键词:django2 celery fdfs haystack whoosh redis nginx 高并发 分布式
主要技术栈
celery:分别负责用户注册异步发送邮件以及不同用户登陆系统动态生成首页
fdfs+nginx:存储网站静态文件,实现项目和资源分离,达到分布式效果
haystack+whoosh+jieba:全文检索框架,修改底层haystack库使之对中文搜索更加友好
redis:作为django缓存和session存储后端,提升网站性能,给予用户更好体验
开发环境
python:3.6.5
django:2.2.10
pycharm:2019.2
OS: windows 10
功能模块
- [x] 用户模块
- [x] 注册
- [x] 登录
- [x] 激活(celery)
- [x] 退出
- [x] 个人中心
- [x] 地址管理
- [x] 商品模块
- [x] 首页(celery)
- [x] 商品详情
- [x] 商品列表
- [x] 搜索功能(haystack+whoosh)
- [x] 购物车模块(redis)
- [x] 增加
- [x] 删除
- [x] 修改
- [x] 查询
- [x] 订单模块
- [x] 确认订单页面
- [x] 订单创建
- [x] 请求支付(支付宝)
- [x] 查询支付结果
- [x] 评论
项目架构图
数据库表分析图
依赖环境和疑难解答
- FDFS配合Nginx的安装
- python3与fdfs交互踩坑记录
- windows上celery4.x不兼容问题完美解决办法
- jieba分词设置修改
- 支付宝sdk接入
- django1.x和2.x的不同之处
项目部署(开发环境)
- 依赖库安装
pip install -U pip
pip install -r requirements.txt
- mysql数据库创建
CREATE DATABASE `dailyfresh` CHARACTER SET 'utf8mb4';
- 启动项目所需服务(win10)
# windows redis的启动,配置文件在redis安装目录下
$ redis-server redis.windows.conf
# 启动celery, 进入项目虚拟环境,在项目根目录下执行
$ celery -A celery_tasks.tasks worker --loglevel=info -P eventlet
启动FastDFS服务, 启动nginx
fdfs的安装方式有两种:
- 1.手动编译安装, 详见此处,
- 2.以docker方式运行
FDFS的安装配置是一件比较麻烦的事情,因此提供FDFS的Dockerfile,
首先把Dockerfile_FDFS 放到一个空目录
中执行如下命令,不然会把项目一起打包到docker上
docker build -t pad0y/fdfs:v3 -f FDFS.dockerfile .
或者
直接下载
,自行构建还是直接拉镜像二选一即可。
docker pull pad0y/fdfs:v3
然后执行
# 当storage和tracker在同宿主机时,必须使用host模式,否则文件上传返回storage内部地址,外部访问无法使用
# MASTER_IP填写自己服务器的ip
docker run -d --name fdfs\
-p 8888:8888 \
-p 22122:22122 \
-p 23000:23000 \
-e TZ=Asia/Shanghai \
-e NET_VAR=eth0 \
-e MASTER_IP=YOUR SERVER IP\
-v /mnt/fdfs:/var/local/fdfs \
pad0y/fdfs:v3
修改utils/fdfs/client_deploy.conf
tracker_server字段为自己服务器的ip
两种方法选择一种即可,建议docker搭建FDFS方便快捷! FDFS环境准备好之后执行如下命令(本地环境安装),docker方式启动无需执行此步骤。
$ /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
$ /usr/bin/fdfs_storaged /etc/fdfs/storage.conf start
$ nginx
项目配置文件修改
1. 重命名Django2_dailyfresh文件夹下的settings.py.example
文件为settings.py
2. 修改数据库配置信息
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'dailyfresh',
'HOST': 'localhost',
'PORT': '3306',
'USER': '#', # 数据库用户名
'PASSWORD': '#', # 数据库密码
}
}
3. 修改邮箱配置信息,163邮箱配置信息自查
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.qq.com'
EMAIL_PORT = 25
EMAIL_HOST_USER = '[email protected]' # 发送邮件的邮箱
EMAIL_HOST_PASSWORD = 'xxxx' # qq邮箱授权码
# EMAIL_USE_TLS = True # 与SMTP服务器通信时,是否启动TLS链接(安全链接)
EMAIL_FROM = '天天生鲜<[email protected]>' # EMAIL_FROM 和 EMAIL_HOST_USER必须一样
4. 填写fdfs的配置信息,注意端口是nginx的端口
FDFS_STORAGE_URL = 'http://ip:port/'
5. 支付功能不需要用到的保持默认即可,需要用到移步官方文档或看配置文件注释
迁移数据库
python manage.py makemigrations
python manage.py migrate
启动
# 创建超级管理员
python manage.py createsuperuser
# 缓存表
python manage.py createcachetable
# 启动服务
python manage.py runserver
效果图
BUGFIX
- 2020.6.06: Bump django from 2.2.10 to 2.2.13
- 2020.4.12: Fixed the background management page display
- 2020.4.02: Fixed CVE-2020-5313 FLI buffer overflow
- 2020.2.12:Fixed CVE-2020-7471 SQL injection
- 2020.1.17:Fixed CVE-2019-19844
- 2019.11.6:Fixed CVE-2019-19118
- 2019.10.23:Bump pillow from 6.1.0 to 6.2.0
后言
如果本项目能帮助到在学习django2的你或者对你有其他帮助记得给个star噢!😉 若有什么需要改进或者疑问的地方欢迎提出issue
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].