Django Structure tool

Django Structure tool window doesnt display applications created using the command python manage.py startapp in the terminal. Version of Pycharm is 2023.3.3

0
It shows the apps added to INSTALLED_APPS setting. Did you add it there?
0

How can I provide hints to this plugin so that it understands my structure?

I have an application with an unconventional project structure with nested applications that is partially recognized by the Django structure tool. In addition to the nested applications I took advantage of python modules and split my settings, my admin entries, forms, models, and tests into separate directories with a file for each component. This results in a *much* cleaner development environment. It should go without saying that all of this works locally and deployed to the cloud and all my tests work. But the Django structure tool only partially recognizes the actual organization. It sees the nested applications and views but not the models. 

The nested apps approach was a design decision that others have questioned me about and with which I have not been overly pleased myself. I recently started looking into containerization and so thought I would take the opportunity to restructure my project and see if the Django plugin would recognize it. I moved my nested apps both into the root directory as per the convention. In fact, I first created the two applications using the Django facet itself, copy and pasted my existing code into the new directory structure and did a file search-replace to update everything. It was a lot less work than I thought it would be. After perhaps 15-20 minutes of work I was able to run the application using the PyCharm runner and my tests are passing. But the Django structure tool now doesn't recognize *anything*. Yes, everything works as it did before.

It's clear to me that Intellij is not using the syntactical insight from the other mechanisms of PyCharm to re-create the “structure” but relying on some brittle and apparently unreliable method of parsing. I spent half-hour trying to decipher how I might describe my project using the “Folder pattern to track files” field only to discover that the field is essentially peripheral to the functioning of the Django plugin. I suspect that the problem is that I have my models in a model folder each with the name of the class or category of model classes that it contains. Or it could be that I have split settings but my settings files are not named “*setting*.py” (they are in the settings folder so the intention would be obvious to any developer). What settings can I use to make the Django structure facet work with my project? It's a bit surprising and rather disappointing that this is still an issue given how long this has been a problem for me and apparently a least a handful of users.

0

请先登录再写评论。