N
N
neulwert2019-11-11 16:13:36
Django
neulwert, 2019-11-11 16:13:36

Where to put code in a django project?

The documentation says:
Do not put any Python code in your web server's document root, because this risks people being able to view your code over the Internet. This is not good for security.
Place your code in some directory outside the document root, such as /home/mycode.
It's not entirely clear to me, I've included a screenshot below. The python code is written to be placed outside the root directory. In my case, the root folder is myvenv. Am I not allowed to store python files in the root folder, as I did with manage.py, that is, create additional folders in myvenv and place them there, as is done with project_A, which contains __init__.py, settings.py, etc?
5dc95c1b19c04893472892.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-11-11
@neulwert

Code should be hosted in applications . Only this is done not for the sake of security, but for decomposition and maintainability.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question