Forums

Added Django Crispy Forms Tailwind but now site won't load - ModuleNotFoundError

I followed the installation steps here - https://github.com/django-crispy-forms/crispy-tailwind - but now I'm getting the error - Something went wrong :-( - went I go on my site. Says: Error code: Unhandled Exception. In the error log it says:

2022-11-15 15:15:35,882: Error running WSGI application 2022-11-15 15:15:35,924: ModuleNotFoundError: No module named 'crispy_tailwind' 2022-11-15 15:15:35,924: File "/var/www/infernox_pythonanywhere_com_wsgi.py", line 28, in <module> 2022-11-15 15:15:35,924: application = StaticFilesHandler(get_wsgi_application()) 2022-11-15 15:15:35,925: 2022-11-15 15:15:35,925: File "/home/infernox/.virtualenvs/django3/lib/python3.8/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application 2022-11-15 15:15:35,925: django.setup(set_prefix=False) 2022-11-15 15:15:35,925: 2022-11-15 15:15:35,925: File "/home/infernox/.virtualenvs/django3/lib/python3.8/site-packages/django/init.py", line 24, in setup 2022-11-15 15:15:35,925: apps.populate(settings.INSTALLED_APPS) 2022-11-15 15:15:35,925: 2022-11-15 15:15:35,926: File "/home/infernox/.virtualenvs/django3/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate 2022-11-15 15:15:35,926: app_config = AppConfig.create(entry) 2022-11-15 15:15:35,926: 2022-11-15 15:15:35,926: File "/home/infernox/.virtualenvs/django3/lib/python3.8/site-packages/django/apps/config.py", line 224, in create 2022-11-15 15:15:35,926: import_module(entry)

I did Pip install that module and also added it to settings.py as the instructions say: INSTALLED_APPS = ( ... "crispy_forms", "crispy_tailwind", ... )

CRISPY_ALLOWED_TEMPLATE_PACKS = "tailwind"

CRISPY_TEMPLATE_PACK = "tailwind"

I have no clue why this is not working. Testing it with just crispy_forms installed worked.

Make sure that you have installed the package that provides crispy_tailwind into the virtualenv that you are using for your web app.

Hi Glenn,

I've done 'pip install crispy-tailwind' on my Virtual Env bash console and the other bash console I had open and still get the same issue. Running it again gives me:

(django3) 11:08 ~/django_projects/mysite (main)$ pip install crispy-tailwind Looking in links: /usr/share/pip-wheels Requirement already satisfied: crispy-tailwind in /home/infernox/.virtualenvs/django3/lib/python3.8/site-packages (0.5.0) Requirement already satisfied: django-crispy-forms>=1.11.2 in /home/infernox/.virtualenvs/django3/lib/python3.8/site-packages (from crispy-tailwind) (1.14.0)

But the issue is still there. As far as I can see, the 2 file paths are the same: In console when doing pip install - /home/infernox/.virtualenvs/django3/lib/python3.8/site-packages

In error log - /home/infernox/.virtualenvs/django3/lib/python3.8/site-packages/django/apps/config.py

If I go to that path in pythonanywhere, I can see 2 paths there for crispy_tailwind/ and crispy_tailwind-0.5.0.dist-info/. So they are there?

Have you reloaded your web app since doing the install?

Oh man, that worked. Thanks Glenn, can't believe I forgot to do that.

Glad to hear that you made it work!