timonweb / django-tailwind

Django + Tailwind CSS = 💚
https://django-tailwind.readthedocs.io
MIT License
1.46k stars 92 forks source link

PyCharm's Tailwind CSS plugin fails to show code assistance without symlinks in project root #57

Closed junctionapps closed 3 years ago

junctionapps commented 3 years ago

This is not an issue with django-tailwind but a note for anyone using it along with PyCharm and the JetBrains Tailwind CSS plug in.

I filed a bug with JetBrains, as the intellisense/code assistance was not working for Django templates inside of the 'normal' app structure of [project root]/app_name/templates/app_name/htmlfiles.html which may eventually make the steps below unnecessary.

It was found that if you create symlinks to node_modules, package.json and tailwind.config.js in the root of the Django project (same directory as manage.py) to the appropriate targets under theme/static_src that the JetBrains official Tailwind CSS plug in works perfectly with the setup described in the django-tailwind's readme.

In the root of your Django project, assuming you named your django-tailwind app 'theme'

ln -s theme/static_src/package.json package.json
ln -s theme/static_src/tailwind.config.js tailwind.config.js
ln -s theme/static_src/node_modules/ node_modules

Reference to JetBrains YouTrack bug tracker: https://youtrack.jetbrains.com/issue/WEB-50354#focus=Comments-27-4829062.0-0

timonweb commented 3 years ago

Thanks for the info. It looks like the Jetbrains Tailwind CSS plugin just assumes you put everything into the root folder.

junctionapps commented 3 years ago

Nothing to be done in django-tailwind