trac 用户管理

bigzhu posted @ Oct 25, 2007 02:44:00 AM in python , 2895 阅读

默认安装好后,进去看的话,是无法登陆的,会报错:

Trac Error

Authentication information not available. Please refer to the installation documentation.

TracGuide – The Trac User and Administration Guide

需要使用之前提到的trac-admin建立用户

先看下help:

trac-admin d:\trac11 permission --help

添加用户:

trac-admin d:\trac11 permission add TRAC_ADMIN bigzhu

这就添加了一个名字叫bigzhu 的admin角色用户

使用这个命令可以看到已经加进去了

trac-admin d:\trac11 permission list

现在要设置密码:

使用这个脚本来设置:

from optparse import OptionParser
import md5

# build the options
usage = “usage: %prog [options]“
parser = OptionParser(usage=usage)
parser.add_option(“-u”, “–username”,action=”store”, dest=”username”, type = “string”,help =”the username for whom to generate a password”)
parser .add_option(“-p”, “–password”,action=”store”, dest=”password”, type = “string”,help =”the password to use”)
( options, args) = parser.parse_args()

# check options
if (options.username is None) or (options.password is None):
parser.error(“You must supply both the username and password”)

# Generate the string to enter into the htdigest file
realm = ‘trac’
kd = lambda x: md5.md5(‘:’.join(x)).hexdigest()
print ‘:’.join((options.username, realm, kd([options.username, realm, options.password])))

使用命令:

生成密码.py -u bigzhu -p m123>> d:\trac11\digest.txt

得到密码

修改启动命令为:

D:\Python25\Scripts\tracd.exe -p 4444 –auth=trac11,d:\trac11\digest.txt,trac d:\trac11

启动,登陆,成功


jnanabhumiap.in 说:
Jan 11, 2024 07:26:49 PM

JNANABHUMI AP provides all the latest educational updates and many more. The main concept or our aim behind this website has been the will to provide resources with full information on each topic which can be accessed through the Internet. To ensure that every reader gets what is important and worthy about the topic they search and link to hear from us. jnanabhumiap.in Jnanabhumi AP is a startup by passionate webmasters and bloggers who are passionate about providing engaging content that is accurate, interesting, and worthy to read. We are more like a web community where you can find different information, resources, and topics on day-to-day incidents or news.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter