Log in

Having trouble intergrating into current project

  • 19 Mar

Sorry typing from phone.

New to Django and python, coming from php.

I have intergrated spirit, updated the installed apps, put the link to the spirit url in my project urls. Etc.

I am trying to add it under a forum category on my main site. I understand intergrating into another large project could be annoying.

How should I link from my forum link to get to the forum?

Really like the style and feel to this so I am really trying to get it to work.

Kind regards, LJ

nitelyEsteban Castro Borsani
  • 19 Mar

How should I link from my forum link to get to the forum?

Well, assuming you have something like url(r'^forum/', include(spirit.urls)), in your urls.py, then just add a link to https://somesite.com/forum/. Now, if you want your site's menu bar at the top of the forum, then you'll probably have to override templates/spirit/_header.html, but it's probably easier to just add a "Home" link or "Back to main" or whatever to Spirit's menu bar. Adding a custom menu bar with custom CSS is not well supported.

This comment was deleted.
probablydrewDrew Probably

I have an application that has a different core functionality, but I want to add a community aspect to it. Here's what I've tried so far:

  • Running spirit startproject forum in a different directory, then cd forum and python manage.py spiritinstall
  • Copying the forum directory, static directory, and settings piece by piece into my own app

Should I keep going down this path, fixing each error as I get it from python manage.py runserver? Or is there some major piece I'm missing? Should I just have run spirit startproject forum from inside my application?

EDIT: It looks like I'm sort of on the right path, based on this issue about integrating into a mezzanine project. Is that right?

nitelyEsteban Castro Borsani
  • 21 Mar

Yes, that's basically it. The issue speaks the truth . Let me know if you hit any issue after following those steps.

probablydrewDrew Probably
  • 22 Mar

Nope, it really was that easy! Now if I want to apply my site's custom styling, it seems that's another matter. Any pointers on that?

nitelyEsteban Castro Borsani
  • 23 Mar

To add extra elements (i.e: a menu bar), it's probably easiest to add an extra CSS file. To include that file override templates/spirit/_base.html. To change the current style, it depends. To change a few things, easiest is t add an extra CSS and override whatever style needed. To change a bunch of things, easiest is probably making changes to Spirit CSS (Sass) [0], compile it and override static/spirit/stylesheets/styles.all.min.css with it.

[0] https://github.com/nitely/Spirit/tree/master/spirit/core/static/spirit/stylesheets/src

Reply