from trac.mimeview.api import Context doesn't work, cannot find Context

Skip to first unread message

Ozgur Polat

May 22, 2020, 7:07:03 PM5/22/20
to Trac Development

I am working on a trac plug-in that I developed a few years ago, I am modifying it on it to put it on my Github account. When I tried the plug-in with the the latest Trac, I get an error. It cannot find the Context. So I went inside 

trac.mimeview.api to search for Context, and I realized that it has been removed and maybe replaced with RenderingContext. Just to see if it would work I tried to replace Context with rendering context but that did not work. I was wondering if anyone had a similar problem and if you know how to fix this?

context = Context.from_request(self.req, 'wiki')

context = RenderingContext.from_request(self.req, 'wiki')

Many thanks.


May 22, 2020, 8:54:18 PM5/22/20
to Trac Development
You'll want to use:

from import web_context

context = web_context(self.req, 'wiki')


Ozgur Polat

May 23, 2020, 9:39:54 AM5/23/20
Hi  RjOllos

This worked, thank you.

You received this message because you are subscribed to the Google Groups "Trac Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages