我该如何重写以下条款:
if u'??????' in date_category['title']:
month = 1
elif u'???????' in date_category['title']:
month = 2
elif u'?????' in date_category['title']:
month = 3
elif u'??????' in date_category['title']:
month = 4
elif u'???' in date_category['title']:
month = 5
elif u'????' in date_category['title']:
month = 6
elif u'????' in date_category['title']:
month = 7
elif u'???????' in date_category['title']:
month = 8
elif u'????????' in date_category['title']:
month = 9
elif u'???????' in date_category['title']:
month = 10
elif u'??????' in date_category['title']:
month = 11
elif u'???????' …Run Code Online (Sandbox Code Playgroud) 我有一个属性app.version,设置为1.2.0(当然,总是在变化),需要创建名为"something-ver-1_2_0"的zip文件.这可能吗?
机械化的Browser类是伟大的,它的follow_link()函数也很棒.但是如何处理这种链接:
<a href="http://example.com"><img src="…"></a>
Run Code Online (Sandbox Code Playgroud)
有没有办法遵循这样的链接?text这种类型的链接的属性很简单'[IMG]',所以AFAIK,没有办法区分这样的链接.任何帮助,将不胜感激.
为具有9个字段的模型实现django ModelForm的最有效的方法是什么,该字段将在模板中分为两列?像这样:
<form>
<div class="column-1">
5 fields for column 1
</div>
<div class="column-2">
4 fields for column 2
</div>
</form>
Run Code Online (Sandbox Code Playgroud) 我是Postfix的新手,只需为Ubuntu设置默认的Postfix,通过telnet测试它并发送邮件确定,但是当我尝试通过django发送邮件时(host ='localhost',port ='25',user =' ',密码=''),我得到了
SMTPException: SMTP AUTH extension not supported by server.
这里是我的main.cf:https://gist.github.com/3348411
你能否建议,我需要添加什么来设置最小工作smtp只是为了发送电子邮件?