cwhisperer
cwhisperer

Reputation: 1926

Error after installing crispy form

I'm new to django but after installing django crispy form with

pip install django-crispy-forms

and having added

'crispy_forms'

in my settings.py, I still have an Unresolved reference when I add

from crispy_forms.helper import FormHelper

in my forms.py

Upvotes: 1

Views: 1661

Answers (1)

Jonathan Warner
Jonathan Warner

Reputation: 345

I had the same problem after installing django-crispy-forms via the console (not with pycharm itself)

The way I solved this problem was:

In pycharm open

Settings then Project -> Project Interpreter

  • click settings (gear symbol on the upper right) select Add
  • selected your current working environment from the Base Interpreter
  • check Inherit global site packages as well as Make available to all projects
  • click ok now you are back on the settings Project Interpreter
  • here click on the plus icon on the upper right
  • in the search-dialog on the upper left search for django-crispy-forms
  • install the package
  • after installation close the dialog
  • back on the settings Project Interpreter click ok (that will close the settings

It takes some seconds while pycharm is updating its settings. After that the message "Unresolved reference..." disappears

I have to say that I don't know if all steps mentioned above are necessary, however in my case they solved the problem.

Upvotes: 6

Related Questions