连接到openstax/accounts的金字塔应用程序示例
openstax-accounts的Python项目详细描述
这是一个连接到openstax/accounts的python金字塔应用程序示例。
安装
- 安装virtualenv
- virtualenv .
- ./bin/python setup.py install
- 设置openstax/服务(请参阅karenc/openstax设置)
- 向openstax/帐户注册此应用程序
- 将development.ini.example复制到development.ini并更改值
- 通过./bin/pserve development.ini 启动应用程序
测试
将testing.ini复制到local_testing.ini并更改值。 只有当您打算对 openstax/accounts的本地实例。
cp testing.ini.example local_testing.ini
下载Chrome驱动程序:
wget 'http://chromedriver.storage.googleapis.com/2.14/chromedriver_linux64.zip
如果没有Chrome:
sudo apt-get install chromium-browser
解压缩chrome驱动程序:
unzip chromedriver_linux64.zip
将chrome驱动程序添加到$PATH:
export PATH=$PATH:.
确保设置了$DISPLAY,例如:
export DISPLAY=localhost:10.0
或者安装xvfb
在没有openstax/帐户的情况下运行测试
xvfb-run ./bin/python setup.py test
或者运行所有测试(包括LOCAL_INI, 需要安装openstax/accounts):
LOCAL_INI=local_testing.ini xvfb-run ./bin/python setup.py test