Chat for Kotti?

32 views
Skip to first unread message

Richard Prosser

unread,
Jun 20, 2017, 4:44:02 AM6/20/17
to Kotti
I am building (I hope) a custom chat server for an online gaming service and Kotti looks promising as a base platform. I have already explored Django, Mezzanine, Wagtail and Flask but all have their shortcomings as far as I am concerned; the Django applications are not flexible enough and Flask lacks a decent TinyCME implementation. I am surprised that there isn't a Flask-based CMS in fact.

Kotti does have some appeal but I am being lazy here as I don't want to spend a lot of time exploring it and then encounter another dead end, so I would appreciate answers to the following, please:

  • How readily could a chat facility be implemented? I expect that I would be able to modify something like Flask-SocketIO-Chat to suit but I am not yet familiar with the Kotti infrastructure.
    • Which server would be required in that case? Gevent/Eventlet?
  • I presume that it would be possible or even easy to show a list of documents (pages) but I can't see anything in the documentation about that. I guess that kotti_blog would be useful.
  • How would I form a URL 'section' like <domain>/games? Is that just a document?
  • Is it easy to integrate Pyramid add-ons?


If Kotti meets my needs then I may well help with a conversion to Python 3 later on, as I prefer to use that.



Thanks ...


Richard


Andreas Kaiser

unread,
Jun 20, 2017, 5:03:50 AM6/20/17
to Kotti

Hi Richard,

On 20 Jun 2017, at 10:44, Richard Prosser wrote:

- How readily could a chat facility be implemented? I expect that I


would be able to modify something like Flask-SocketIO-Chat


not yet familiar with the Kotti infrastructure.

I've not used it, but assuming the docs are correct https://gevent-socketio.readthedocs.io/en/latest/ should be easy to integrate into any Python WSGI App.

- Which server would be required in that case? Gevent/Eventlet?

The above would require gevent.

- I presume that it would be possible or even easy to show a list of


documents (pages) but I can't see anything in the documentation about that.

I guess that kotti_blog <https://github.com/Kotti/kotti_blog> would be
useful.

That's indeed very easy with Kotti. You'd basically

  1. construct a SQLAlchemy query that returns the documents you want to show in a view:

    from pyramid.view import view_config
    from kotti.resources import Document

    @view_config(name='myview', renderer='mytemplate.pt', …)
    def myview(context, request):
    documents = Document.query.filter(<whatever your criteria are>)
    return {'documents': documents}

  2. and then iterate over those in mytemplate.pt:

    <li tal:repeat="d documents"><a href="request.resource_url(d)">${document.title}</a></li>

- How would I form a URL 'section' like <domain>/games? Is that just a
document?

That'd be an arbitrary Node of any type in your content tree, for example a document.

- Is it easy to integrate Pyramid add-ons?

Kotti is plain Pyramid. Therefore you can use any Pyramid add on as you would in any other Pyramid application.

If Kotti meets my needs then I may well help with a conversion to Python 3
later on, as I prefer to use that.

That'd be great. In fact all the base work is done already (no dependencies without Python 3 compatibility). It just hasn't been done yet, because of missing time.

HTH,

Andreas

Richard Prosser

unread,
Jun 20, 2017, 7:17:23 AM6/20/17
to Kotti
Many thanks Andreas - that all looks useful.


Cheers,

Richard

Reply all
Reply to author
Forward
0 new messages