Django Mailformer公司
django-mailformer的Python项目详细描述
现在,如果您已经在projects requirements.txt中添加了此应用程序,则可以通过以下步骤开始使用此应用程序:
代码::console
pip安装git+ssh://git@github.com/developersociety/django mailformer.git@master\egg=django mailformer
1)在设置文件中将“mailformer”添加到应用程序中。
2)在URL中。py添加到URL模式中:
代码::console
urlpatterns=[
所有其他值
url(r'^email/',include('mailformer.url'),
]
不要在
include中定义名称空间,因为这将阻止查找用于
表单和提交成功页面的url的内部过程。但是,如果需要,可以对
进行操作,但是您需要直接添加表单和
提交页面,并覆盖constants.url\u name值。
3)在模板中添加`{%load mailformer%}`
4)显示电子邮件的任何位置将其替换为:
。code::console
<;a href=“{%get_url_by_email email_address%}”>;
<;/a>;
,其中“email_address”是您要发送到的电子邮件地址。
您还可以添加其他键,以便表单获得预填值。
这些键是:[name,phone_number,subject,消息]
字段“identifier”是隐藏的,但却是必需的。
<5)您应该通过创建名为
`mailformer/mailformer form.html'的提交表单和名为
`mailformer/mailformer success.html'的成功表单来定义自己的表单。
` virtualenvwrapper<;https://virtualenvwrapper.readthedocs.io/en/latest/>;`
和“开发协会开发工具”<;https://github.com/developer society/tools>;``ux。
假设您正在使用这些工具,开始这个项目非常简单:
。代码::console
$dev clone example\u instance
$make reset
您现在可以运行开发服务器:
……代码::console
===
history
==
<0.0.0(2017-06-14)
----
*初始提交
<0.0.0b(2017-06-22)
----
*重构到新布局
代码::console
pip安装git+ssh://git@github.com/developersociety/django mailformer.git@master\egg=django mailformer
1)在设置文件中将“mailformer”添加到应用程序中。
2)在URL中。py添加到URL模式中:
代码::console
urlpatterns=[
所有其他值
url(r'^email/',include('mailformer.url'),
]
不要在
include中定义名称空间,因为这将阻止查找用于
表单和提交成功页面的url的内部过程。但是,如果需要,可以对
进行操作,但是您需要直接添加表单和
提交页面,并覆盖constants.url\u name值。
3)在模板中添加`{%load mailformer%}`
4)显示电子邮件的任何位置将其替换为:
。code::console
<;a href=“{%get_url_by_email email_address%}”>;
<;/a>;
,其中“email_address”是您要发送到的电子邮件地址。
您还可以添加其他键,以便表单获得预填值。
这些键是:[name,phone_number,subject,消息]
字段“identifier”是隐藏的,但却是必需的。
<5)您应该通过创建名为
`mailformer/mailformer form.html'的提交表单和名为
`mailformer/mailformer success.html'的成功表单来定义自己的表单。
` virtualenvwrapper<;https://virtualenvwrapper.readthedocs.io/en/latest/>;`
和“开发协会开发工具”<;https://github.com/developer society/tools>;``ux。
假设您正在使用这些工具,开始这个项目非常简单:
。代码::console
$dev clone example\u instance
$make reset
您现在可以运行开发服务器:
……代码::console
===
history
==
<0.0.0(2017-06-14)
----
*初始提交
<0.0.0b(2017-06-22)
----
*重构到新布局