Around the installation of the Python project management framework Trac

trac_logo.png

0. Introduction

Suddenly, I wanted to do ticket-driven development, and I was curious about what happened to Trac, which was popular a few years ago and I don't hear much about it now, so I installed it.

Speaking of Trac, Trac Lightning for Windows is famous, but to be honest, I don't recommend it to programmers. That's because Trac Lightning puts various plug-ins in the ruggedness, and honestly, the functions that I do not use at all interfere with it, and it is troublesome to delete them one by one, so this time I installed and operated pure Trac Tell me the story.

This story is I am talking based on ** Trac ver 1.0.4 **.

Information on v0.1 and v0.12, which is the most popular Trac, is on the WEB, but this time I will use the latest v1.0.4. The settings are different! Please do not mourn. (Wailed person w

1. Download

Since it is made of Python, it can be installed with pip.

only this. (As expected, Python! I fall in love with it w I long for it w)

2. Trac Preferences & Initialization

Create a folder to save the set of projects operated by Trac.

For the time being, I created a folder called Main.

You can configure Trac with trac-admin. ./Main is the directory you just created initenv is to initialize in that directory.

So, when I hit the command, it doesn't look like the following ... It's actually in English, so please proceed somehow.

Screenshot from 2015-03-01 20:12:36.png

There are two items. Project name and database selection. The project name is main this time The database is enter and uses the default SQLite. SQLite best w

3. Start up the server

I hate Apache (because it's huge beyond my understanding), so this time it's Python, so why not have a simple server? I thought it was included in Trac as standard.

tracd is Trac's server app, --port is the port number setting, but --host is also available. The rest is a directory declaration.

Gradually launch your browser and try to access localhost: 1121 to the suspicious demon.

Screenshot from 2015-03-01 20:15:15.png

Then, the following site will appear, and when you click the link,

Screenshot from 2015-03-01 20:15:38.png

Will be. (Oh? I'm sorry if you noticed that the menu is in English, please understand that I will write the method of Japaneseization later.)

Congratulations. The installation of Trac has been completed successfully. Next is the story of passwords and Japanese localization.

4. Create password

Login with Trac is Basic-login. I think I could have selected other Login methods, but I'm not sure, so I'll pass.

So, here as well, various sites say to use Apachi, but here we generate hash code with Python.

pass.py


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()
str = ':'.join((options.username, realm, kd([options.username, realm, options.password])))

f = open("login","w")
f.write(str)
f.close()

A little modification of the official sample,

5. Login

Now that the login file is created, start the server again.

As you can see, --auth has been added. --auth is --auth = , , . The formula is written with a different name, but it looks like my image.

If you start it with this, if you go safely, the ticket creation tab will increase.

6. Japanese localization

Trac uses Subversion, so put it in first.

Put it in something like that

So download the file and

Install with.

And when I start Tracd again, I think the menu is a little Japanese.

7. Finally

I don't think many people know about Trac now, so http://ja.wikipedia.org/wiki/Trac It's a little old http://itpro.nikkeibp.co.jp/article/COLUMN/20080414/298973/ You may be able to grasp the situation if you see (Honestly, Trac and ticket-driven have been popular since around 2010, so there may be better ones now. Also, Trac became Ver1.0 in 2012, and now it is Ver1.0.4. )

The reason I chose Trac is because it's made by Python! !! It is w

8. Tricks tech?

If you need a backup, you can copy the entire set of directories specified by trac-admin. This is wonderful. Plus, there's raw SQLite in the db directory, so you can even rebuild it. Great.

Also, if you have multiple projects, use trac-admin to create a new one or copy an existing file.

tracd --host $HOST --port PORT --auth=*,login,trac ./Project1 
--auth=*,login,trac ./$Project2 \

It's OK if you make a good script. Great.

Since Trac is made of Python, there are probably more tricks. Even with regard to the server, I wonder if it can be done because it runs on uwsgi ~ Fufufu w Excuse me for being bad. w

Recommended Posts

Around the installation of the Python project management framework Trac
The Python project template I think of.
the zen of Python
Installation of Python 3.3 rc1
Installation of matplotlib (Python 3.3.2)
[Trainer's Recipe] I touched the flame of the Python framework.
Tasks at the start of a new python project
Towards the retirement of Python2
About the ease of Python
About the features of Python
Source installation and installation of Python
The Power of Pandas: Python
Initial setting of Mac ~ Python (pyenv) installation is the fastest
A memorandum of understanding for the Python package management tool ez_setup
The story of Python and the story of NaN
Installation of SciPy and matplotlib (Python)
[Python] The stumbling block of import
First Python 3 ~ The beginning of repetition ~
[Understanding in the figure] Management of Python virtual environment by Pipenv
Existence from the viewpoint of Python
pyenv-change the python version of virtualenv
Change the Python version of Homebrew
[Python] Understanding the potential_field_planning of Python Robotics
Installation of Python, SciPy, matplotlib (Windows)
Review of the basics of Python (FizzBuzz)
About the basics list of Python basics
Learn the basics of Python ① Beginners
Installation method using the pip command of the Python package (library) Mac environment
Try using the Python web framework Django (1)-From installation to server startup
Installation of Visual studio code and installation of python
Introducing the BOT framework Minette for Python
Change the length of Python csv strings
Check the behavior of destructor in Python
Understand the benefits of the Django Rest Framework
[Python3] Understand the basics of Beautiful Soup
Pass the path of the imported python module
Python installation and package management with pip
The story of making Python an exe
Learning notes from the beginning of Python 1
Check the existence of the file with python
About the virtual environment of python version 3.7
[Python] Understand the content of error messages
[Python3] Rewrite the code object of the function
I didn't know the basics of Python
The result of installing python in Anaconda
[Python] Try pydash of the Python version of lodash
[python] Checking the memory consumption of variables
Check the path of the Python imported module
The story of manipulating python global variables
[python] [meta] Is the type of python a type?
The basics of running NoxPlayer in Python
Pandas of the beginner, by the beginner, for the beginner [Python]
Project Euler # 16 "Sum of Powers" in Python
In search of the fastest FizzBuzz in Python
Python Basic Course (at the end of 15)
Set the process name of the Python program
[Python] Get the character code of the file
The story of blackjack A processing (python)
Intuitively learn the reshape of Python np
Python Note: The secret role of commas
Project Euler # 17 "Number of Characters" in Python