随笔分类 -  python

摘要:学习http://docs.djangoproject.com/en/dev/topics/auth/?from=olddocs#writing-an-authentication-backend记录authetication backend是一个类,实现了两个方法:get_user(user_id)与authenticate(**credentials).get_user函数有一个参数user_id,它可以是username,database ID或其他,返回一个User对象实例。authenticate方法有一个名为credentials的关键字参数。一般情况,它如下:class MyBa 阅读全文
posted @ 2013-04-25 15:44 M' 阅读(516) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python# -*- coding: utf-8 -*-# 2/10/16 base trans. wrote by srcdog on 20th, April, 2009# ld elements in base 2, 10, 16.import os,sys# global definition# base = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F]base = [str(x) for x in range(10)] + [ chr(x) for x in range(ord('A') 阅读全文
posted @ 2013-04-23 09:04 M' 阅读(365) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示