datasette-secret-santa by simonw

星标

README 源代码

datasette-secret-santa

PyPI Changelog Tests License

使用 Datasette 运行秘密圣诞老人

安装

在 Datasette 相同的环境中安装此插件。

datasette install datasette-secret-santa

在 Glitch 上运行

https://glitch.com/ 是托管此应用程序的好方法。

您可以在 Glitch 上复制此项目 来获得自己的副本。

或者您可以创建一个新的应用程序,并将以下内容粘贴到您的 glitch.json 文件中

{
  "install": "pip3 install --user datasette datasette-secret-santa -U",
  "start": "datasette --create .data/santa.db -p 3000"
}

然后访问您新应用的首页,点击链接创建一个新的秘密圣诞老人分组。

用法

Animated GIF showing the plugin in action - the user adds three names, then gets the password for their account - then hits the assign button and uses their password to find out who they have been assigned.

此插件需要一个名为 santa.db 的数据库。您可以像这样运行它并创建这样一个数据库

datasette santa.db --create

它期望是唯一安装的插件,并将接管 / 首页。

要创建一个新的秘密圣诞老人,请访问 /santa/create_secret_santa(从首页链接)。

开发

要在本地设置此插件,请首先检出代码。然后创建一个新的虚拟环境

cd datasette-secret-santa
python3 -m venv venv
source venv/bin/activate

现在安装依赖项和测试依赖项

pip install -e '.[test]'

运行测试

pytest