GithubHelp home page GithubHelp logo

chatroom's Introduction

chat

安装需求

apt-get install redis-server

pip3 install redis python-redis gunicorn gevent

如果执行上述安装报错,尝试下面两项

apt-get install build-essential

apt-get install python3-dev

开启redis

redis-server&

使用 gunicorn 启动

gunicorn --worker-class=gevent -t 9999 redischat:app -b 0.0.0.0:3000

开启 debug 输出

gunicorn --log-level debug --worker-class=gevent -t 999 redis_chat81:app

把 gunicorn 输出写入到 gunicorn.log 文件中

gunicorn --log-level debug --access-logfile gunicorn.log --worker-class=gevent -t 999 redis_chat81:app

redis安全相关问题

nano /etc/redis/redis.conf

如果实际路径不一样,可以用以下指令查找

find / -name redis.conf

在conf找到 bind 127.0.0.1 这行,把前面的注释去掉,保存

开启redis的方式改为

redis-server /etc/redis/redis.conf &

更新记录

1,增加注册登录

2,聊天室内容会被保存到数据库

3,创建数据库相关操作使用models.py文件

python3 models.py

chatroom's People

Contributors

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