27👍
Please try this – it works for me for templates:
- set templates directories in Python Template Languages -> Template directories
- in Project Structure mark your apps as Source Folders
EDIT :
After a project structure reorganization I had problem with static files again. Setting destination of setting.py
file in Django Support -> Settings resolved the issue.
14👍
Right click on the templates directory and “Mark Directory As” -> “Template Directory” and select template language as django
13👍
I’ve solved this problem by editing settings for Django framework, as seen on a picture.
- Why use Django's collectstatic instead of just serving the files directly from your static directory?
- One project, Multiple customers with git?
11👍
You need to set up your project properly.
Django Set Up
In Preferences | Languages & Frameworks | Django
, Enable Django Suport, set up the path to your project’s root, settings.py
file, and manage.py
file:
Mark your templates directory as Templates
In File | Settings | Project Structure
for Windows/Linux and
PyCharm | Preferences | Project Structure
for macOS, choose the directory to be marked as a template root.
Click on Templates
on Mark as
.
- Click on OK to apply the changes you made.
0👍
The issue for me was that I was doing this in my settings module:
INSTALLED_APPS = [*INSTALLED_APPS, "debug_toolbar"]
This caused PyCharm to think that debug_toolbar
is the only app in the entire project. Declaring INSTALLED_APPS
in the standard way solved it.