我必须在静态网站上添加联系表单.我已经有了一些表格的经验,使用django/python完成2或3,但遗憾的是使用django不是一个选项,它必须添加到静态网站.你能告诉我我有哪些选择吗?
我试图在django 1.3,python 2.6中建立一个联系表单.
什么是跟随错误的原因?
错误:
SMTPRecipientsRefused at /contact/
{'test@test.megiteam.pl': (553, '5.7.1 <randomacc@hotmail.com>: Sender address
rejected: not owned by user test@test.megiteam.pl')}
Run Code Online (Sandbox Code Playgroud)
我的settings.py:
EMAIL_HOST = 'test.megiteam.pl'
EMAIL_HOST_USER = 'test@test.megiteam.pl'
EMAIL_HOST_PASSWORD = '###'
DEFAULT_FROM_EMAIL = 'test@test.megiteam.pl'
SERVER_EMAIL = 'test@test.megiteam.pl'
EMAIL_USE_TLS = True
Run Code Online (Sandbox Code Playgroud)
编辑:如果任何其他人跟随djangobook,这是导致它的部分:
send_mail(
request.POST['subject'],
request.POST['message'],
request.POST.get('email', 'noreply@example.com'), #get rid of 'email'
['siteowner@example.com'],
Run Code Online (Sandbox Code Playgroud) 随着今天的win8.1更新,我们得到了新的IE11,它可以在高dpi显示器上自动扩展网站(实际上它甚至可以在15英寸屏幕上将1920x1080扩展到125%)
在测试我前段时间制作的几个视差网站时(使用了scrollorama),我注意到这种缩放效果会影响我发生某些动画的预定义滚动点.
有没有办法阻止这种行为?
我发现了这个:http://msdn.microsoft.com/en-us/library/ie/dn265030(v = vs.85).aspx
但是,明确地设置X-UA-TextLayoutMetrics为gdi或者normal似乎没有为我做的工作,是否有任何先决条件?
我正在使用django迈出第一步,目前我正在尝试使用简单的搜索解决方案为我的网站使用:http://julienphalip.com/post/2825034077/adding-search-to-a-django-site-in -a-SNAP
这是代码的样子:
search.py
import re
from django.db.models import Q
def normalize_query(query_string,
findterms=re.compile(r'"([^"]+)"|(\S+)').findall,
normspace=re.compile(r'\s{2,}').sub):
''' Splits the query string in invidual keywords, getting rid of unecessary spaces
and grouping quoted words together.
Example:
>>> normalize_query(' some random words "with quotes " and spaces')
['some', 'random', 'words', 'with quotes', 'and', 'spaces']
'''
return [normspace(' ', (t[0] or t[1]).strip()) for t in findterms(query_string)]
def get_query(query_string, search_fields):
''' Returns a query, that is a combination of Q objects. That combination …Run Code Online (Sandbox Code Playgroud) 我试图在每次下订单后给自己发送一封电子邮件。我的问题是,$order->get_total()以及get_total_tax返回0而不是实际订单总值。
add_action( 'woocommerce_new_order', 'custom_after_order_created_hook', 12 , 1);
function custom_after_order_created_hook($order_id) {
$order = new WC_Order($order_id);
$with_tax = $order->get_total();
$tax = $order->get_total_tax();
$without_tax = $with_tax - $tax;
$to = "test@example.com";
$subject = "New order";
$content = "
New order {$order->id}
With tax: {$with_tax}
Without tax: {$without_tax}
Tax: {$tax}
";
$status = wp_mail($to, $subject, $content);
}
Run Code Online (Sandbox Code Playgroud)
除了 $order_id 之外的每个值$order->id都被评估为 0。 $order_id 具有适当的值。此问题仅在使用woocommerce_new_orderhook时发生(我也尝试在自定义页面上使用它 - 工作正常),这让我感到疑惑。
我不确定这里有什么问题,我的代码的某些部分是异步的吗?
或者这个钩子可能在订单被支付的价格/税收信息更新之前被调用?
我应该怎么做才能在此处获取价格信息?
谢谢。
我需要让这个小的灰色矩形(红色圆圈)显示在一个div的顶部n底部,它包含缩略图(顺便说一下这个div可能还有2或3行缩略图)
图片:

这是我看起来如何的代码:
.jq_thumbnails {
background: url("/site_media/static/coffee_small_top.png") top left no-repeat;
overflow: auto;
height: 100%;
}
Run Code Online (Sandbox Code Playgroud)
是否有可能轻松实现这一效果?我想制作ifequal标签来检查缩略图列表的长度并相应地使用某个背景图片,但也许只有使用html/css才能实现这个目的?