-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] PyCharm Integration with django-cookiecutter #5239
Comments
That's a weird one. PR to fix welcome. Out of curiosity, does it work if you modify the installed apps with
Wondering if that would mess things up or if it's supported? PS: not suitable for |
|
Yes I think it matters for whitenoise, as I said before, the order is important for this app, so your suggestion is better |
Did you fill in a bug report by jetbrains? |
Description:
We recently migrated a substantial project to the
django-cookiecutter
framework. Following this transition, we encountered significant issues with our IDE (PyCharm). Specifically, autocompletion within HTML templates stopped functioning correctly. This affected template tags such as{% include ... %}
and{% static ... %}
, which has been quite disruptive.Initially, we mitigated the problem for the
{% include ... %}
tag by marking template directories as "Template Directories." However, this solution did not resolve issues related to{% static ... %}
.Investigation:
We suspected that our project-specific configurations might be causing these issues. However, upon testing with an empty
django-cookiecutter
project, we found that the problem persisted. This led us to conclude that PyCharm's Django integration might be struggling to detect the Django structure in projects created withdjango-cookiecutter
.To pinpoint the issue, we incrementally recreated the cookiecutter setup to observe when PyCharm's integration failed. We identified the following line in
local.py
as the culprit:It appears that PyCharm is unable to handle the unpacking operation when reading the
INSTALLED_APPS
list.Therefore leading to
"no apps found"
PyCharm message.Solution:
By modifying the
INSTALLED_APPS
assignment as shown below, PyCharm's Django integration functions correctly, and autocompletion is restored:This change allows PyCharm to detect the Django structure properly.
Attachments:
Test:
Tested with PyCharm Professional
Build #PY-241.18034.82, built on June 24, 2024
This problem has also occured for older versions of PyCharm.
The text was updated successfully, but these errors were encountered: