Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.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 如何添加函数';在其他计算机上注销';?_Python_Django_Django Admin - Fatal编程技术网

Python 如何添加函数';在其他计算机上注销';?

Python 如何添加函数';在其他计算机上注销';?,python,django,django-admin,Python,Django,Django Admin,例如,我经常忘记在其他人的计算机上注销您的站点,但并不总是有机会返回并注销。如何从我的计算机上创建一个功能,自动关闭除当前会话之外的所有会话?我认为有多种方法可以解决这个问题。下面是我使用的一个 使用TMOUT 将以下行添加到bash启动文件中,例如$HOME/.bash\u profile,或者在/etc/profile.d目录中创建一个名为timout-settings.sh的新bash shell脚本: ## append in $HOME/.bash_profile ## 300 sec

例如,我经常忘记在其他人的计算机上注销您的站点,但并不总是有机会返回并注销。如何从我的计算机上创建一个功能,自动关闭除当前会话之外的所有会话?

我认为有多种方法可以解决这个问题。下面是我使用的一个

使用TMOUT

将以下行添加到bash启动文件中,例如$HOME/.bash\u profile,或者在/etc/profile.d目录中创建一个名为timout-settings.sh的新bash shell脚本:

## append in $HOME/.bash_profile
## 300 seconds == 5 minutes ##
TMOUT=300
readonly TMOUT
export TMOUT
或/etc/profile.d/timout-settings.sh

#!/bin/bash
## 300 seconds == 5 minutes ##
TMOUT=300
readonly TMOUT
export TMOUT

“我经常忘记登录你的网站”。所以这取决于mysite。如果我提供了一个API,那么只有你才能使用它。