Coder Social home page Coder Social logo

angelliang / hacking-pyfly Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xiuqianli1996/pyfly

0.0 1.0 0.0 1 MB

Flask + Layui Fly Template实现的一个社区项目,使用flask-admin实现了简单的后台管理功能,数据库使用Mongodb,前台实现功能:用户注册、登录、邮件激活、发帖、回帖、点赞、回复、采纳、删帖、结贴等功能

License: MIT License

Python 21.20% CSS 18.45% JavaScript 15.63% HTML 44.72%

hacking-pyfly's Introduction

PyFly

更新记录

2018.06.13 学校专业实训的第三天,实在太闲,进行了一下压测,吞吐量惨不忍睹,加上redis缓存,稍微好了一些

2018.06.11 实现简单的签到功能,奖励为1-100的随机值

2018.05.08 开发者审核迟迟未通过,没法玩微博账号登录,突然想起搜索还没做,看了一会whoosh文档就开了撸了一波代码,用了jieba分词,效果还行

项目介绍

Flask + Layui Fly Template实现的一个社区项目,使用flask-admin实现了简单的后台管理功能,数据库使用Mongodb,前台实现功能:用户注册、登录、邮件激活、发帖、回帖、点赞、回复、采纳、删帖、结贴等功能

软件架构

1.前端模板:Layui Fly Template

2.Flask + flask-pymongo + flask-admin + flask-login + flask-mail

安装教程

git clone https://gitee.com/981764793/PyFly

安装MongoDB
修改mongodb连接信息,STMP邮箱账号密码(用户注册验证用到)


pip install -r requirements.txt

python manager.py runserver

使用说明

  1. 首次打开会自动往MongoDB新增一些默认数据(管理员账号和默认配置项),后台管理(flask-admin简单实现): http://127.0.0.1:5000/admin

  2. 可自己修改扩展模板作为信息分类网站或者简单的cms、博客

3.19应届小菜鸟初学Python的作品,都做得比较粗糙,希望各位大佬指正,另外如果能有个实习岗位就更好了,邮箱:[email protected]

4.图片上传可选保存到后端或图床,默认保存到服务器,如果要开启图床上传在/static/js/mods/index.js搜索开启图床注释和解开相应注释后即可,然后在user.js进行相应操作,图床使用了SM.MS图床

模板开发

1.全局过滤器mongo_date_str(格式化mongodb的日期字段)

2.全局函数:

1)get_page(collection_name, pn=1, size=10, sort_by=None, filter1=None) 分页查询 pn页码 sort_by为tuple类型,目前只支持单字段排序,详情可看模板
2)get_list(collection_name, sort_by=None, filter1=None, size=None) 列表查询
3)find_one(collection_name, filter1=None) 获取单条
4)date_cal(d1, num, is_add=True) 计算日期

Todo

1.社交账号登录

2.暂时没想到。。。

截图预览

首页1

首页2

发帖

回帖

个人设置

用户主页

hacking-pyfly's People

Watchers

 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.