夹层CMS研讨会平台
mezzanine-seminars的Python项目详细描述
夹层研讨会
为Mezzanine站点提供的研讨会平台。在
特点
- 创建包含公共和私人内容的研讨会
- 接受付款以授予用户访问研讨会的权限
- 使用注册码可以在不付费的情况下访问选定的用户组
- “专题”(类别)制度,按专题分组讨论会
- 允许与会者填写“研讨会后调查”以提供反馈
- 研讨会注册的CSV导出
变更日志/历史记录/发行说明
退房GitHub Releases。在
安装
- 通过pip安装:
pip install mezzanine-seminars
。在 - 将
"mezzanine_seminars"
添加到INSTALLED_APPS
。确保还添加了"mezzanine.accounts"
。在 - 添加到根目录
urls.py
:
url("^seminars/",include("mezzanine_seminars.urls",namespace="seminars"))
- 一个新的研讨会部分将出现在管理。创建你的第一个研讨会!在
- 将您的访问者指向
/seminars/
以查看可用研讨会的列表。在
接受付款
默认情况下,注册研讨会是完全免费的,即使研讨会有固定的价格。您可以使用settings.SEMINARS_REGISTRATION_FORM
中的自定义表单来强制执行付款要求。不同的支付处理者需要不同的形式:
条纹
首先,确保使用pip install mezzanine-seminars[stripe]
安装附加要求。然后确保在settings.STRIPE_SK
中定义了您的秘密API密钥。在开发过程中,这应该是一个测试密钥。在
最后,设置用户注册研讨会时要使用的条带表单:
^{pr2}$这将处理后端配置,但您需要重写seminars/seminar_registration_create.html
来配置条带的浏览器绑定stripe.js
。这在Stripe's official docs中有解释,但归根结底是在名为stripe_method
的隐藏字段中发送PaymentMethod ID。这样服务器就可以完成购买。在
注册代码
有些用户可能会在不使用网站的情况下付费访问研讨会,或者您(网站所有者)可能与他们签订了一项特殊协议,允许他们免费访问研讨会内容。注册码允许你这样做。下面是一个例子:
ACME Inc. has reached an agreement with you for 20 seats for Seminar XYZ. Site admins create the Purchase Code "acme" with the capacity limited to 20. Employees of ACME Inc. will now create their own accounts on the site and enter code "acme" during the registration step for Seminar XYZ instead of paying for their registration. Once the code has been used on 20 registrations it is no longer valid. Site admins will be able to see which code was used in the Seminar Registration admin to identify the 20 attendees from ACME. Multiple Purchase Codes can be active at the same time to allow enrolling multiple user groups, each with a set number of seats.
一般来说,你会希望结合注册码和另一种支付方式,给用户选择使用。为此,提供了形式mezzanine_seminars.forms.BaseRegistrationCodeForm
,以便与其他形式混合使用。在
例如,要允许用户使用条带或注册码注册:
# your_app/forms.pyfrommezzanine_seminars.formsimportBaseRegistrationCodeFormfrommezzanine_seminars.forms.stripeimportStripeRegistrationFormclassCombinedRegistrationForm(BaseRegistrationCodeForm,StripeRegistrationForm):""" Seminar Registration form that supports both Stripe and Registration Codes """# settings.pySEMINARS_REGISTRATION_FORM="your_app.forms.CombinedRegistrationForm"
贡献
在您提供错误修复或添加新功能之前,请检查问题跟踪器并打开一个新问题来讨论要完成的工作。一旦你清楚了你想在代码库上工作:
git clone git@github.com:unplugstudio/mezzanine-seminars cd mezzanine-seminars # Test suite pip install -e .[testing] pytest tests # Code style pip install flake8 black flake8 . black . # ALTERNATIVE: have Tox run everything (tests and code style) pip install tox tox
完成更改并确保所有测试都通过后,创建一个pull请求并验证continuos集成测试也通过了。在
- 项目
标签: