本文整理汇总了Python中models.Log.save_log_note方法的典型用法代码示例。如果您正苦于以下问题:Python Log.save_log_note方法的具体用法?Python Log.save_log_note怎么用?Python Log.save_log_note使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Log
的用法示例。
在下文中一共展示了Log.save_log_note方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main_page
# 需要导入模块: from models import Log [as 别名]
# 或者: from models.Log import save_log_note [as 别名]
def main_page(request):
"""главная вьюха
Arguments:
- `request`:
"""
if request.method == 'POST':
radioform = SetPassForm(request.POST)
radioform.is_valid()
num_passwords = int(radioform.cleaned_data['num_pass'])
passwords = gen_passwords(os.path.dirname(__file__) + '/dicts/' + radioform.cleaned_data['language'],
num=num_passwords,
lenth=int(radioform.cleaned_data['lenth_pass']),
upper=radioform.cleaned_data['upper_pass'],
numbers=radioform.cleaned_data['string_replace_num'])
else:
passwords = gen_passwords(os.path.dirname(__file__) + '/dicts/italian')
num_passwords = 10
radioform = SetPassForm({'num_pass':'10', 'lenth_pass':'10', 'language':'italian', 'upper_pass': True, 'string_replace_num': True})
count = Counter()
log = Log()
counter = count.get_counter(num_passwords)
log.save_log_note(request.META['HTTP_USER_AGENT'], request.META['REMOTE_ADDR'])
return render_to_response('index.html', {
'counter':counter,
'passwords':passwords,
'radioform':radioform,
'browser':request.META['HTTP_USER_AGENT'],
'ip':request.META['REMOTE_ADDR']
}, context_instance = RequestContext(request))