GithubHelp home page GithubHelp logo

evido3s / commodity-analysis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from buhuipao/commodity-analysis

0.0 2.0 0.0 98 KB

基于Flask的商品历史价格可视化及比价,演示的网站:

Home Page: http://buhuipao.cn/

Python 84.27% HTML 15.73%

commodity-analysis's Introduction

这是妹子的毕业设计,是一个类似于慢慢买, 盒子比价网的商品价格比较、可视化的小系统

项目的目录结构基本为:

├── README.md
├── app.py
├── configs.py
├── configs.pyc
├── forms.py
├── forms.pyc
├── mydict
├── plots.py
├── plots.pyc
├── proxy.py
├── search.py
├── search.pyc
├── spider
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── amazon.py
│   ├── amazon.pyc
│   ├── jd.py
│   └── jd.pyc
├── sql
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── db.py
│   └── db.pyc
├── static
│   ├── e_history.png
│   └── e_history_low.png
├── templates
│   ├── 404.html
│   ├── 500.html
│   ├── base.html
│   ├── index.html
│   ├── info.html
│   └── search.html
└── test
    ├── datetime.html
    └── plots.py

想让这个项目跑起来需要做一些准备

首先你需要准备一个MongoDB数据库, 推荐使用Dokcer的mongo镜像直接装一个, 于是需要先安装Docker, 详细步骤参考Docker官方文档:https://www.docker.com/get-docker, 在正确安装Docker之后,参考https://hub.docker.com/_/mongo/安装Mongo数据库,详细步骤如下:

#以认证的模式启动一个mongo容器
sudo docker run -v .data:/data/db -p 27017:27017 --name mymongo -d mongo --auth    

sudo docker exec -it mymongo mongo admin          #进入容器执行初始化命令, 并创建goods数据库

sudo docker ps                #确保容器正确运行

>db
admin

>db.createUser(
  { user: 'buhuipao',
    pwd: 'some-hard-guess-password',
    roles: [
      {role: "userAdminAnyDatabase",
        db: "admin"
      }
    ]
   });
Successfully added user: {
    "user" : "buhuipao-admin",
    "roles" : [
        {
            "role" : "userAdminAnyDatabase",
            "db" : "admin"
        }
    ]
}

>use goods

>db.createUser(
  {
    user: "buhuipao",
    pwd: "some-hard-guess-password",
    roles: [ { role: "readWrite", db: "goods" }]
  }
)

由于安装了大量了第三方库, 在准备好数据库之后,需要使用如下命令安装多个第三方库;

sudo pip install -r requirfile

安装完之后,直接运行:gunicorn -w 2 app:app就可以在浏览器http://127.0.0.1:5000看见界面了

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.