Answer the question
In order to leave comments, you need to log in
How to move the root of a Django project to a subdirectory inside a PyCharm project?
When you create a pure Django project in PyCharm, it creates all the necessary folders with files (similar to django-admin startproject django_prj
) and makes settings inside the PyCharm project (how and where to run manager.py
, for example). This creates a directory structure in the PyCharm project folder:
PROJECT
├───.idea
├───.git
├───prj
├───app
├───templates
└─manage.py
PROJECT
├───.idea
├───.git
├───django_prj
│ ├───prj
│ ├───app
│ ├───templates
│ └─manage.py
└─другие_файлы
PROJECT/django_prj/django_prj/settings.py
instead PROJECT/django_prj/manage.py
of ... with obvious consequences. No Additional options or Custom run command can convince him to run what I need ( Custom run command - just adds everything that you write in it after the server start line; Additional options - adds everything that is written in it in the same line but before specifying the IP:PORT of the servermanage.py
and tries to launch django-admin.py
from the project's virtual environment. The Additional options and Custom run command settings behave in the same way as in the previous paragraph, to convince you to search and run exactly manage.py
, and at the same time it doesn’t work where you need it.Answer the question
In order to leave comments, you need to log in
Solution: In the project tree, right-click the django_prj folder and select mark directory as source root !
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question