Code Monkey home page Code Monkey logo

django2_dailyfresh's Introduction

CSDN Build Status Finish

天天生鲜-django2.2版本

简介

本项目替换原项目框架django1.8为最新版的django2.2.5(已修复为2.2.8),该项目包含了实际开发中的电商项目中大部分的功能开发和知识点实践, 是一个非常不错的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.8
pycharm:2019.2
OS: win10

功能模块

  • 用户模块
    • 注册
    • 登录
    • 激活(celery)
    • 退出
    • 个人中心
    • 地址管理
  • 商品模块
    • 首页(celery)
    • 商品详情
    • 商品列表
    • 搜索功能(haystack+whoosh)
  • 购物车模块(redis)
    • 增加
    • 删除
    • 修改
    • 查询
  • 订单模块
    • 确认订单页面
    • 订单创建
    • 请求支付(支付宝)
    • 查询支付结果
    • 评论

项目架构图

项目架构图

数据库表分析图

数据库表分析图

环境配置

项目部署(开发环境)

  • 依赖库安装
pip install -U pip
pip install -r requirements.txt
  • mysql数据库创建
CREATE DATABASE `dailyfresh` CHARACTER SET 'utf8';
  • 启动项目所需服务(win10)
# windows redis的启动,配置文件在redis安装目录下
$ redis-server redis.windows.conf

# 启动celery, 进入项目虚拟环境,在项目根目录下执行
$ celery -A celery_tasks.tasks worker --loglevel=info -P eventlet

启动FastDFS服务, 启动nginx

$ /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
$ /usr/bin/fdfs_storaged /etc/fdfs/storage.conf start
$ nginx

迁移数据库

python manage.py makemigrations
python manage.py migrate

启动

python manage.py runserver

BUGFIX

后言

如果本项目能帮助到在学习django2的你或者对你有其他帮助,give me a star 若有什么需要改进或者疑问的地方欢迎提出issue

django2_dailyfresh's People

Contributors

pad0y avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.