This tool consists of two parts; recording part and ui part. There are two ways for configuring the recording part. The first one is to use django middleware which appstats offers. Another way is to configure WSGI middleware. The former way is much easier, so I tried to utilize this django middleware with Kay.
I have thought that I could easily utilize this middleware with small modifications because Kay has a middleware mechanism very similar to the django's one. Finally, and fortunately I can use this middleware without any modification. That's what I aimed for by implementing Kay's middleware mechanism as similarly as possible to django's one!
MIDDLEWARE_CLASSES = ( 'appstats.recording.AppStatsDjangoMiddleware', 'kay.auth.middleware.AuthenticationMiddleware', )
Configuring the recording part is done by adding appstats.recording.AppStatsDjangoMiddleware to the MIDDLEWARE_CLASSES as above.
Next I need to configure ui part. According to the documentation of appstats, I added an entry to my app.yaml as follows.
- url: /stats.* script: appstats/ui.py login: admin
This is nearly perfect, but a handlers for viewing source code didn't work correctly, so I needed to add these lines to the upper part of
Updated, thanks Guido!
import kay kay.setup_syspath()
That's all. Now I can use appstats with Kay framework. Here are some screenshots.
No comments:
Post a Comment