二手庙

码农软件 · 软件分类 · 网店系统/电子商务 · 2020-02-01 17:42:17

软件介绍

网站安装指南 这里指针对Ubuntu 其他系统请参考

本网站基于web.py框架制作 分为两个部分,数据抓取以及网站展现。 数据库采用sqlite

如何安装web.py请参考

http://webpy.org/install

抓取部分

目录中Get文件夹内文件负责抓取信息

抓取之前你应该安装如下依赖库:

requests,pyquery

安装后执行:

python Get.py

可以抓取数据

在服务器中可利用 crontab进行定时抓取,本源码中已经写好了sh文件只需要如下操作

先编辑文件根目录的get.sh

vim get.sh

修改为你的路径

python /home/yourfile/get.py

然后加入crontab

crontab -e
*/10  * * * * sh /home/yourfile/get.sh

即可。

注意:建议删除数据库文件重新抓取。

展现部分

启动应用需要安装 gunicorn

pip install gunicorn

安装后启动服务

gunicorn -w 8 app:ershou

启动服务后默认端口为8000默认只允许127.0.0.1访问也就是只允许本机访问。 调试的时候可以加上如下参数

gunicorn -w 8 0.0.0.0:8000 app:ershou

这样就可以任意地址访问了。

Nginx 配置,把xmiao.org更换为你自己的域名就可以了。

server {
  listen 80;
  server_name xmiao.org www.xmiao.org;
  access_log  /var/log/nginx/example.log;

  location / {
      proxy_pass http://127.0.0.1:8000;

      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}

server {
    listen 80;
    server_name ershou.miaowu.asia;

    location / {
        rewrite     ^   http://www.xmiao.org$request_uri? permanent;
    }
}

本文地址:https://codercto.com/soft/d/24675.html

The Linux Command Line

The Linux Command Line

William E. Shotts Jr. / No Starch Press, Incorporated / 2012-1-17 / USD 39.95

You've experienced the shiny, point-and-click surface of your Linux computer-now dive below and explore its depths with the power of the command line. The Linux Command Line takes you from your very ......一起来看看 《The Linux Command Line》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

html转js在线工具
html转js在线工具

html转js在线工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具