I’m new to Django and need to understand file structure. below is an example of my Django project (some files missing)
My confusing is to do with production on a real server and how my file structure relates.
I have the following questions on this issue which I think if answered will help me understand.
- Where is the web root?
- How do you stop users from downloading settings.py?
-
Its this structure ok?
project manage.py templates [folder] myapp1 [folder] models.py views.py projectname [folder] urls.py settings.py
There is no web root. Django project files can be placed anywhere for a web server to run and serve at a given URL. URL’s do not correspond to file structure.
Django should never be exposed to the public. You stop users from downloading it by not exposing it to the public. Only static media should ever be accessible from the web.
Yes, your structure is okay. That’s the recommended new standard.