Giter Club home page Giter Club logo

nomooc's Introduction

NoMooc本地环境安装

命名规范

  • pr 标题commit 信息 必须以 功能关键字: 开头,命名形式为[功能关键字]: [名称]分支 名必须以 功能关键字/开头,命名形式为[功能关键字]/[名称]

    功能关键字介绍如下:

    • feat ✨ - 新功能(feature)
    • refactor 🔨 - 重构原有功能或模块
    • fix 🐛 - 修补 bug
    • docs 📝 - 文档(document)
    • style 💄 - 格式(不影响代码运行的变动)
    • test ✅ - 增加测试
    • chore 💚 - 构建过程或辅助工具的变动
    • revert - 撤销
    • close - 关闭 issue
    • release - 发布版本

Curr_Env

python 3.6
mysql 5.7
redis 3.0.6
django 1.1.14
  • 数据库配置根据本地做相应修改

    # oj/dev_setting.py
    
    DATABASES = {
        "default": {
            "ENGINE": "django.db.backends.mysql",
            "HOST": "127.0.0.1",
            "PORT": "3306",
            "NAME": "oj_database",
            "USER": "root",
            "PASSWORD": "xxxxxx",
            "CHARSET": "utf8",
    
        }
    }
    
    REDIS_CONF = {
        "host": "127.0.0.1",
        "port": "6379"
    }
    
  • 安装依赖库

    pip install --no-cache-dir -r deploy/requirements.txt -i https://pypi.douban.com/simple
    
  • 初始化数据库

    # python3 manage.py makemigrations
    # python3 manage.py migrate
    
  • 修改deploy/supervisord_local.conf文件

    [program:task_celery]
    command=/root/.pyenv/shims/celery -A oj worker -l warning
    ;directory=/OnlineJudge/
    stdout_logfile=data/log/task_celery.log
    stderr_logfile=data/log/task_celery.log
    autostart=true
    autorestart=true
    startsecs=5
    stopwaitsecs = 5
    killasgroup=true
    
    
    [program:beat_celery]
    command=/root/.pyenv/shims/celery -A oj beat -l warning
    stdout_logfile=data/log/celery_beat.log
    stderr_logfile=data/log/celery_beat.log
    autostart=true
    autorestart=true
    startsecs=5
    stopwaitsecs = 5
    killasgroup=true
    
    
    [program:gunicorn]
    command=/root/.pyenv/shims/gunicorn oj.wsgi -b 127.0.0.1:8080 --reload -w 3 -k gevent
    stdout_logfile=data/log/gunicorn.log
    stderr_logfile=data/log/gunicorn.log
    autostart=true
    autorestart=true
    startsecs=5
    stopwaitsecs = 5
    killasgroup=true
    
    

    /root/.pyenv/shims/celery以及/root/.pyenv/shims/gunicorn的执行路径,换为你本地的执行路径,我这里是虚拟环境的执行路径

如果一切正常,服务将监听在 127.0.0.1:8080

nomooc's People

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.