django-学习-验证码

写一个前后端分离的小项目,一边看django,一边看vue.
在写用户登录注册的时候,需要验证码,这时候用到了django-simple-captcha
下面是这个其中的一个模型类:

>>> 

class CaptchaStore(django.db.models.base.Model)
 |  CaptchaStore(*args, **kwargs)
 |
 |  CaptchaStore(id, challenge, response, hashkey, expiration)
 |
 |  Method resolution order:
 |      CaptchaStore
 |      django.db.models.base.Model
 |      builtins.object
 |
 |  Methods defined here:
 |
 |  __str__(self)
 |      Return str(self).
 |
 |  challenge = <django.db.models.query_utils.DeferredAttribute object>
 |  expiration = <django.db.models.query_utils.DeferredAttribute object>
 |  get_next_by_expiration = _method(self, *, field=<django.db.models.fields.DateTimeField: expiration>, is_next=True, **kwargs)
 |
 |  get_previous_by_expiration = _method(self, *, field=<django.db.models.fields.DateTimeField: expiration>, is_next=False, **kwargs)
 |
 |  hashkey = <django.db.models.query_utils.DeferredAttribute object>
 |  id = <django.db.models.query_utils.DeferredAttribute object>
 |  response = <django.db.models.query_utils.DeferredAttribute object>
 |  save(self, *args, **kwargs)
 |      Save the current instance. Override this in a subclass if you want to
 |      control the saving process.
 |
 |      The 'force_insert' and 'force_update' parameters can be used to insist
 |      that the "save" must be an SQL insert or update (or equivalent for
 |      non-SQL backends), respectively. Normally, they should not be set.
 |
 |  ----------------------------------------------------------------------
 |  Class methods defined here:
 |
 |  create_pool(count=1000) from django.db.models.base.ModelBase
 |	
 |  generate_key(generator=None) from django.db.models.base.ModelBase
 |
 |  pick() from django.db.models.base.ModelBase
 | 
 |  remove_expired() from django.db.models.base.ModelBase
    调用它可以一次删除过期的数据库中的行
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值