这个Django视图如何需要HTTPS?

2024-09-27 21:30:15 发布

您现在位置:Python中文网/ 问答频道 /正文

(r'^login/?$','django.contrib.auth.views.login',{'template_name':'login.html', 'authentication_form':CustomAuthenticationForm}),

我该如何添加HTTPS?我通常会有一个装修工来做。。在

但在这种情况下,我不能应用它。在

^{pr2}$

Tags: djangonamehttpsformauthauthenticationhtml情况
1条回答
网友
1楼 · 发布于 2024-09-27 21:30:15

我相信您可以这样包装函数:

from django.contrib.auth.views import login
from <<wherever>> import secure_required


urlpatterns = patterns('',
    (r'^login/?$',secure_required(login),{'template_name':'login.html', 'authentication_form':CustomAuthenticationForm}),
)

相关问题 更多 >

    热门问题