Log in

Integrating with current content based website

dubloonsJesse Hodges
  • 1
  • 22 Feb

I currently have a Django website/wiki. Pages are stored as Django model objects. I would like to have a Spirit thread (category) for each of these pages shown under the page content.
Is there a way to attach Spirit threads to my models and somehow integrate them into my current templates? Perhaps you can point me in the right direction?

nitelyEsteban Castro Borsani
  • 23 Feb

Is there a way to attach Spirit threads to my models

Not out of the box. Spirit is not a comment system and it sounds like that's what you want. However, you can just add a OneToOne field to the thread model in your page model or create a new model that works as an intermediate table relating both models. Then auto-create a new thread when a page is created. But I'm not 100% sure a thread can have no comments, there are no tests for that use-case AFAIK it may work or not, although you could create a dummy comment.

and somehow integrate them into my current templates? Perhaps you can point me in the right direction?

A lot of manual work. You would have to copy the comment list template and adapt it to your template. Also copy the comment view and adapt it to your page view.

That said, I think something like disqus is what you want.

dubloonsJesse Hodges
  • 1
  • 23 Feb

I'm hoping to have users create topics (rather than comment on one topic). So a page would be associated with a spirit category (rather than a Spirit topic), allow users to create topics for that page (which is why I'm hoping for a forum library rather than a comment library). Does Spirit support multiple Django sites?
Any further suggestions would be appreciated.

nitelyEsteban Castro Borsani
  • 1
  • 23 Feb

Oh, I see. So you want a wiki article to be associated to a category. Well the answer is basically the same as above, just replace thread by category and comment by thread in my previous comment. Except categories can be empty (no threads) so it would easier to integrate.

Does Spirit support multiple Django sites?

It does not support the site framework[0] if that's what you mean. You can only have a single Spirit forum per database.

[0] https://docs.djangoproject.com/en/1.10/ref/contrib/sites/

dubloonsJesse Hodges
  • 24 Feb

Thank you!

Reply