django的第一个问题

/usr/local/lib/python2.7/dist-packages/allauth/account/utils.py in setup_user_email, line 258

/usr/local/lib/python2.7/dist-packages/allauth/account/utils.py 中函数有问题

python基本的语法,成员变量

QuerySet相关的函数位于

/home/hon/django/django/db/models/query.py中

这个数据库只是用来写自己的

EmailAddress.objects.get_or_create,

这个库里还有一些问题,就是不能生成sqlite的表,调用 python manage.py makemigrations app_name生成migrations文件

是因为在函数:/usr/local/lib/python2.7/dist-packages/allauth/account/form.py文件中:class SignupForm中的save函数中,有如下代码,在save_user的时候,已经把相关的账户信息合入到了utils之中,最后兜兜转转到了save_user-->adaptor.

312     def save(self, request):
313 adapter = get_adapter(request)
314 user = adapter.new_user(request)
315 adapter.save_user(request, user, self)
316 self.custom_signup(request, user)
317 # TODO: Move into adapter `save_user` ?
318 setup_user_email(request, user, [])
319 return user

是因为在这个函数栈之中,这个而函数栈之中 

  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 149, in get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 147, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
return view(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 63, in bound_func
return func.__get__(self, type(self))(*args2, **kwargs2)
File "/usr/local/lib/python2.7/dist-packages/allauth/account/views.py", line 177, in dispatch
return super(SignupView, self).dispatch(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/allauth/account/views.py", line 66, in dispatch
**kwargs)
File "/usr/local/lib/python2.7/dist-packages/allauth/account/views.py", line 155, in dispatch
**kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/allauth/account/views.py", line 82, in post
response = self.form_valid(form)
File "/usr/local/lib/python2.7/dist-packages/allauth/account/views.py", line 192, in form_valid
self.user = form.save(self.request)
File "/usr/local/lib/python2.7/dist-packages/allauth/account/forms.py", line 315, in save
adapter.save_user(request, user, self)
File "/usr/local/lib/python2.7/dist-packages/allauth/account/adapter.py", line 232, in save_user
user.save()
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/base_user.py", line 74, in save
super(AbstractBaseUser, self).save(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 708, in save
force_update=force_update, update_fields=update_fields)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 745, in save_base
update_fields=update_fields, raw=raw, using=using)
File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 192, in send
response = receiver(signal=self, sender=sender, **named)
File "/home/hon/recruit/accounts/models.py", line 57, in create_account_emailaddress
email=instance.email
File "/usr/local/lib/python2.7/dist-packages/allauth/account/managers.py", line 25, in get_or_create
上一篇:连接postgres特别消耗cpu资源而引发的PostgreSQL性能优化考虑


下一篇:Java的Timer定时器