Log in

Installing Spirit to an existant project

bastien34baste roc
  • 28 Mar

Hi,

I've got a Django project in which I'd like to integrate Spirit app. I'm not sure how to do it as the doc is very light on this point.

For now, I've installed it using pip. I configured my urls.py to include Spirit urls into forum/ name space and I've added Spirit to my INSTALLED_APPS with no success. Then I've included Spirits settings into my project settings using this: "from spirit.settings import *" But I got djconfig errors. And I don't understand why there is no migration in that project.

Is there a step by step howto explaining the easiest way to integrate Spirit to an existant project ? (I use Django 1.10, python 3.6)

Thanks !

nitelyEsteban Castro Borsani
  • 28 Mar

The example has everything you need.

Then I've included Spirits settings into my project settings using this: "from spirit.settings import *"

If you do that you must extend the settings and be careful when overwriting them. Another way is to copy the content from spirit.settings.py into your settings and start from there. Either merging your project settings into spirit settings or the spirit settings into your project settings.

And I don't understand why there is no migration in that project.

djconfig does has migrations, Spirit has them as well.

bastien34baste roc
  • 1
  • 28 Mar

Edit: My error is now LookupError: No installed app with label 'djconfig'.

nitelyEsteban Castro Borsani
  • 28 Mar

No idea. Can you paste the full traceback here?

bastien34baste roc
  • 28 Mar

I've just edited my last message. The error is related to 'djconfig'. LookupError: No installed app with label 'djconfig'

nitelyEsteban Castro Borsani
  • 1
  • 28 Mar

Well it looks like you don't have djconfig installed... you should probably add it to your installed_apps...

I'm not sure how it can even be missing though. It's right there in the spirit.settings.py file.

bastien34baste roc
  • 28 Mar

Thanks ! You point it right, I forgot to add 'djconfig' in the INSTALLED_APPS. Now it works.

Do you have an idea about the impact of all these spirit middlewares on the site performance ?

nitelyEsteban Castro Borsani
  • 28 Mar

Do you have an idea about the impact of all these spirit middlewares on the site performance ?

Yeah, they do nothing most of the time.

Except for djconfig which will query the database to check if the config was updated, if it was (which is rare) then it makes second query to retrieve the key/values. But it's a pretty fast query. In any case I could use the django cache to store the updated_at info, someday, maybe.

bastien34baste roc
  • 1
  • 28 Mar

OK, thank you for your answers !

Reply