简体   繁体   English

django allauth没有从事生产工作

[英]django allauth not working on production

I can't login or signup on my production server. 我无法在生产服务器上登录或注册。 Configuration is same for local and development server. 本地和开发服务器的配置相同。 I used same settings for both of them, same requirements installed in order to identify what's wrong but no hope. 我对它们使用了相同的设置,安装了相同的要求,以便找出错误但没有希望。

python manage.py check
System check identified no issues (0 silenced).

some of related configuration 一些相关的配置

SITE_ID = 1

from django.core.urlresolvers import reverse_lazy

LOGIN_REDIRECT_URL = reverse_lazy('amazon_advertising:home')
LOGIN_URL = reverse_lazy('account_login')
LOGOUT_URL = reverse_lazy('account_logout')

ACCOUNT_AUTHENTICATION_METHOD = "username_email"
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_USERNAME_REQUIRED = False
ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 7
ACCOUNT_EMAIL_VERIFICATION = "mandatory"

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    'allauth.account.auth_backends.AuthenticationBackend',
)

I can login and logout django admin panel but django allauth login do not work. 我可以登录并注销django管理面板但是django allauth登录不起作用。 There is no error just waiting in response. 只是等待响应没有错误。

on production server I run it with 在生产服务器上我运行它

python manage.py 0.0.0.0:8000

I tried nginx+gunicorn same problem exists. 我试过nginx + gunicorn存在同样的问题。

Login view is successfully parsed with my custom template but can not login or signup. 使用我的自定义模板成功解析了登录视图,但无法登录或注册。

Edit: If I give wrong credentials in login it response me perfectly with "The login and/or password you specified are not correct." 编辑:如果我在登录时提供了错误的凭据,它会完美地回答“您指定的登录名和/或密码不正确”。 but if credentials are right nothing happens. 但如果凭证是正确的,没有任何反应

Ok I found it. 好的我找到了。 When made ACCOUNT_EMAIL_VERIFICATION = "optional" I successfully logged in. That was the superuser created from python manage.py createsuperuser which not automatically verify email. 当ACCOUNT_EMAIL_VERIFICATION =“可选”时,我成功登录。这是从python manage.py createsuperuser创建的超级用户,它不会自动验证电子邮件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM