Giter VIP home page Giter VIP logo

weeklyreport's Introduction

截图(V0.1):https://blog.mcloud.fun:81/post/weekly-report/

#加入docker-compose

可以在新机器上, 直接一键启动了: docker-compose up

加入entrypoint.sh脚本: 1 启动时先等待pg启动 2 判断pg里是否已经有表 3 如果没有表, 初始化表 4 用gunicorn 启动 app

快速运行

-w <N>为开启的gunicorn worker进程数 -p 8000:80 主机通过8000端口访问

git clone https://github.com/CodingCrush/WeeklyReport && \

cd WeeklyReport && \

docker build -t weeklyreport:0.2 . && \

docker run -d \
        --restart=unless-stopped \
        --name weeklyreport-server \
        -p 8000:80 \
        -v /etc/localtime:/etc/localtime:ro \
        -v $PWD:/opt/weeklyreport \
        weeklyreport:0.2 \
        gunicorn wsgi:app --bind 0.0.0.0:80 -w 2 --log-file logs/awsgi.log --log-level=DEBUG

更新说明

V0.2: 简化了部署步骤

配置说明

  • 配置数据库 数据库默认使用sqlite,也可以使用postgres container,cd到postgres目录下,pull镜像,启动。 数据库URI地址由数据库名、用户名、密码、主机、端口号组成。
SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:postgres@localhost/wr_prd'

步骤见postgres目录下的readme.md

  • 配置config.py

DEPARTMENTS: 这个元组为部门列表,第一次打开时自动初始化到数据库中,用户在注册时可以选择部门。

MAIL_USERNAME : 用来发送邮件通知的邮箱账号

MAIL_PASSWORD : 用来发送邮件通知的邮箱密码

后台管理

第一次注册的用户为超级管理员,永远有登录后台的权限。 管理员可以修改其他角色

默认用户角色为EMPLOYEE,仅具有读写自己的周报的权限,

MANAGER可以读写周报,并查看本部门所有周报。而HR可以读写周报,并查看全部门所有周报。

ADMINISTRATOR在HR基础上增加了进入后台的功能。

QUIT用来标识离职后的员工,禁止其登录。

weeklyreport's People

Contributors

codingcrush avatar xuqinghan avatar t3573393 avatar

Watchers

James Cloos 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.