johnfraney/django-bootstrap-customizer

when bootstrap customizer data is missing it doesn't gracefully handle the error

Closed this issue · 2 comments

  • Package version: django-bootstrap-customizer = "^0.1.3"
  • Django version: 2.2
  • Python version: 3.7.4
  • Operating System: WSL / Ubuntu 18.04
  • Env: Pyenv, poetry, postgres

Description

Trying to use bootstrap customizer in my app. I expected bootstrap customizer to run without errors out of the box. It looks like it needs a fixture and some initial data to work properly.

What I Did

Install the bootstrap customizer app

./manage.py runserver

The error

  File "/home/nautel/.cache/pypoetry/virtualenvs/fosscred-py3.7/lib/python3.7/site-packages/bootstrap_customizer/templatetags/bootstrap_customizer.py", line 11, in bootstrap_theme_css_above_the_fold
    bootstrap_theme = context['request'].bootstrap_theme
AttributeError: 'WSGIRequest' object has no attribute 'bootstrap_theme'

@strike5150 Thanks for reporting this. I'm working on two changes that should help:

  1. Adding more informative error messages when trying to use the template tags without a BootstrapTheme and a BootstrapSiteTheme configured in the admin
  2. Adding a management command to create a BootstrapTheme and a BootstrapSiteTheme so it's easier to get up and running

I'm working on docs and the release now, so it'll be out soon!

Fixed in version v0.3.0