Page WikiStart not found

44 views
Skip to first unread message

Vigneshwaran Raveendran

unread,
Jan 10, 2013, 8:30:09 AM1/10/13
to trac...@googlegroups.com
Hi Trac team,

I am trying to create environments programmatically using trac.env.Environment api. But the WikiStart page is missing.

I get this error instead of the start page.

Trac Error
Page WikiStart not found

Other features look fine. How do I get the WikiStart page? This doesn't happen when I use "trac-admin <env_name> initenv"

This is my code:

env_options = [
    ('header_logo', 'src', PROJECT_LOGO),
    ('header_logo', 'link', TRAC_ROOT + '/' + config.projectName)
    ('inherit', 'plugins_dir', PLUGINS_DIR),
    ('logging', 'log_type', 'file'),
    ('project', 'descr', 'Trac for ' + config.projectName),
    ('project', 'name', config.projectName)
]
new_env = Environment(path, True, env_options)

Thank you,
Vigneshwaran

Christian Boos

unread,
Jan 10, 2013, 8:39:56 AM1/10/13
to trac...@googlegroups.com
Hello,

On 1/10/2013 2:30 PM, Vigneshwaran Raveendran wrote:
> Hi Trac team,
>
> I am trying to create environments programmatically using
> trac.env.Environment api. But the WikiStart page is missing.
>
> I get this error instead of the start page.
>
> Trac Error
>> Page WikiStart not found

Indeed, Environment() creates an environment with very little content,
in particular there's no wiki pages.

>
>
> Other features look fine. How do I get the WikiStart page? This doesn't
> happen when I use "trac-admin <env_name> initenv"

Precisely, you should have a look at the implementation of that command,
`do_initenv`, you'll see it does a `WikiAdmin(self.__env).load_pages(...)`).

Sorry for the minimalistic help, but the best answer is really to
look-up in the code ;-)

-- Christian

Vigneshwaran Raveendran

unread,
Jan 10, 2013, 9:47:28 AM1/10/13
to trac...@googlegroups.com
Hi Christian Boos,

On Thursday, January 10, 2013 7:09:56 PM UTC+5:30, Christian Boos wrote:
Precisely, you should have a look at the implementation of that command,
`do_initenv`, you'll see it does a `WikiAdmin(self.__env).load_pages(...)`).

Thanks a lot for the pointer.

I only had to add two more lines:

pages_dir = pkg_resources.resource_filename('trac.wiki', 'default-pages') 
WikiAdmin(new_env).load_pages(pages_dir)

Thanks,
Vigneshwaran 
Reply all
Reply to author
Forward
0 new messages