Where are the files? This is not PHP
One of the most difficult ideas to get used to, especially if you are from the PHP or ASP.NET world, is that the source files are not located in your web server's document root directory, which is usually named wwwroot
or public_html
. Additionally, there is no direct relationship between the code's directory structure and the website's URL structure.
In fact, you will find that your Django website's source code is stored in an obscure path such as /opt/webapps/my-django-app
. Why is this? Among many good reasons, it is often more secure to move your confidential data outside your public web root. This way, a web crawler will not be able to accidentally stumble into your source code directory.
As you will read in Chapter 13, Production-Ready, the location of the source code can be found by examining your web server's configuration file. Here, you will find either the DJANGO_SETTINGS_MODULE
environment variable being set to the module's path, or it will pass...