Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/365.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Django中,如何为用户生成欢迎消息?_Python_Html_Css_Django - Fatal编程技术网

Python 在Django中,如何为用户生成欢迎消息?

Python 在Django中,如何为用户生成欢迎消息?,python,html,css,django,Python,Html,Css,Django,比如: Welcome {user that is logged in}! 它应该在用户登录时显示。 谢谢大家! 您必须创建自己的登录视图,然后可以使用消息显示欢迎消息,如: from django.contrib import messages messages.success(request, gettext("Login successfully !")) # gettext is for the translation, you don't need it

比如:

Welcome {user that is logged in}!
它应该在用户登录时显示。
谢谢大家!

您必须创建自己的登录视图,然后可以使用消息显示欢迎消息,如:

from django.contrib import messages    
messages.success(request, gettext("Login successfully !"))
# gettext is for the translation,  you don't need it

这回答了你的问题吗?请帮助为您的问题添加一些细节,谢谢!