saythanks.io项目分析(1) 运行
项目地址:
https://github.com/BlitzKraft/saythanks.io
Kennethreitz 写的一个简单的网站(基于 Flask),用于向开源项目作者发送感谢邮件的 Web App。
该项目结构简单,可以用来学习大神是如何快速开发 Web 项目、方法、代码风格、开发常用库。
下载解压,安装依赖库
pip install -r requirements.txt
ruamel库安装会报错,先注释
#ruamel.ordereddict==0.4.9
#ruamel.yaml==0.14.11
安装依赖库
pip install -r requirements.txt
运行
$ python t.py
会用到一些环境变量,是关于邮件和认证,但本机没有,所以运行会报错,修改
$ vi ./saythanks.io-master/saythanks/email.py
#API_KEY = os.environ['SENDGRID_API_KEY']
API_KEY = '123456'
$ vi ./saythanks.io-master/saythanks/storage.py
#auth0_domain = os.environ['AUTH0_DOMAIN']
#auth0_token = os.environ['AUTH0_JWT_TOKEN']
auth0_domain = 'admin.com'
auth0_token = '123456'
db = records.Database('sqlite:////tmp/test.db')
$ vi ./saythanks.io-master/saythanks/core.py
#auth_id = os.environ['AUTH0_CLIENT_ID']
#auth_secret = os.environ['AUTH0_CLIENT_SECRET']
#auth_callback_url = os.environ['AUTH0_CALLBACK_URL']
#auth_domain = os.environ['AUTH0_DOMAIN']
auth_id = '123456'
auth_secret = '123456'
auth_callback_url = ''
auth_domain = ''
运行
$ python t.py
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 445-147-373
转载:https://blog.csdn.net/liangkiller/article/details/102486088
查看评论