### Navigation

- index
- modules |
- next |
- previous |
- The Sage Notebook »

# Sage Trac Server

This module configures and launches a Trac server, if an optional package (e.g., trac-x.y.z.spkg) is installed.

`sage.server.trac.trac.``trac`(directory='sage_trac', port=10000, address='localhost', open_viewer=False, auto_reload=False, easy_setup=False, options='')

  Start a Trac server, creating a new project, if necessary. An “optional” Sage package trac-x.y.z.spkg must already be installed. (Use optional_packages() to get the exact name.)

  INPUT:

  - `directory` - a string (default: ‘sage_trac’); name of the project directory
  - `port` - an integer (default: 10000); the server’s port number
  - `address` - a string (default: ‘localhost’); the server’s address
  - `open_viewer` - a bool (default: False); whether to open a browser at the server’s address
  - `auto_reload` - a bool (default: False); whether the server should restart automatically when its sources are modified
  - `easy_setup` - a bool (default: False); if creating a new project, whether to enable optional plug-ins. See `trac_create_instance()`.
  - `options` - a string (default: ‘’); command-line options to pass directly to tracd

`sage.server.trac.trac.``trac_create_instance`(directory='sage_trac', easy_setup=False)

  Create a new Trac project instance if Trac is installed.

  INPUT:

  - `directory` - a string (default: ‘sage_trac’); the name of the project directory
  - `easy_setup` - a bool (default: False); whether to use the project name ‘Sage’, the default database, enable the webadmin plugin, and enable the source browser for the ‘sage’ Mercurial repository.

  Note

  To access the webadmin panel, first create a user, give that user admin permissions, and log in as that user. Create new accounts using htdigest (part of Apache):

      cd <directory>/conf
      htdigest passwd <server_address> <username>

  Grant a user administrative privileges with:

      trac-admin <directory> add <username> TRAC_ADMIN

### Navigation

- index
- modules |
- next |
- previous |
- The Sage Notebook »