GithubHelp home page GithubHelp logo

xatuxue / demo-django-supermarket Goto Github PK

View Code? Open in Web Editor NEW

This project forked from djanchew/demo-django-supermarket

0.0 0.0 0.0 20.11 MB

毕业设计-超市管理系统(django)

Shell 0.03% JavaScript 1.33% Python 97.35% CSS 1.29%

demo-django-supermarket's Introduction

demo-django-supermarket

毕业设计 (2019)

环境配置 (Ubuntu 18.04)

数据库 (mysqlclient)

  1. 系统需要装好 default-libmysqlclient-dev
> sudo apt-get install default-libmysqlclient-dev python3.7 python3.7-dev
  1. pip 升级

参考
https://stackoverflow.com/a/64095095

> pip3 install -U pip
> pip3 install -U setuptools
  1. pip3 install mysqlclient
  2. 本机安装好 mysql 服务并启动 sudo /etc/init.d/mysql start
  3. 使用/创建用户 admin, 使用创建数据库 demo_django_supermarket (root权限下)
    • 创建数据库
    mysql> CREATE DATABASE demo_django_supermarket DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    • 检查数据库默认编码
    mysql> USE demo_django_supermarket;
    mysql> SELECT @@character_set_database, @@collation_database;
    +--------------------------+----------------------+
    | @@character_set_database | @@collation_database |
    +--------------------------+----------------------+
    | utf8mb4                  | utf8mb4_unicode_ci   |
    +--------------------------+----------------------+
    1 row in set (0.00 sec)
    
    mysql> SHOW TABLE STATUS FROM demo_django_supermarket;
    (略)
    • 创建数据库连接用户并授权
    mysql> CREATE USER 'admin'@'localhost' IDENTIFIED BY '123456';
    mysql> GRANT ALL PRIVILEGES ON demo_django_supermarket.* TO 'admin'@'localhost';

初始化数据

  1. migrate 迁移/初始化数据库
> python3 manage.py makemigrations
> python3 manage.py migrate
  1. 设置一个超级管理员 admin (admin@123456)

参考 https://docs.djangoproject.com/en/4.0/howto/initial-data/

> python3 manage.py loaddata fixtures/*

开始

  1. 启动服务
> python3 manage.py runserver localhost:8001

若启动以 0.0.0.0:8001 还能在局域网内的其他设备访问

TODO

  • 使用 docker 来启动 mysql 和本服务
  • fixture/migrate 增加初始化商品数据的
  • migrate 增加模拟销售数据
  • 接口文档 wiki
  • 测试开发环境配置(换一个机器重新开发)
  • 测试用例

demo-django-supermarket's People

Contributors

djanchew 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.