我的默认项目文件夹是启动与登录应用程序在它。如何在登录后通过用户名或用户名登录表单提交django
登录应用urls.py: -
url(r'^$', views.LoginFormView.as_view(), name='index'),
网址登录页面。
内登录应用views.py:提交并重定向到用户的个人资料页
LoginFormView(TemplateView):
..........
.........
if user is not None:
if user.is_active:
login(request, user)
# messages.add_message(request, messages.INFO, 'Login Successfull.')
return redirect('indexClient')
登录表单。
启动urls.py: -
url(r'^client/', views.IndexClientView.as_view(), name='indexClient'),
启动views.py: -
class IndexClientView(TemplateView):
template_name = 'startup/index-client.html'
我需要的URL更换客户与用户名在登录时输入形成。
也许会返回一个HTTP响应而不是重定向,并处理正在执行登录的前端的重定向? – Zohair