I created a new project and a virtual environment to start over on a project I am working on.
When I look in the project’s root directory, the folders/files there are different.
The old one contains:
\/ assets
\/ admin
\/ css
\/ img
\/ js
\/ css <- I created this to hold my static css file
# styles.css
The new project only had the .venv folder, which the old project doesn’t have, for the new virtual environment I created for the project. I added assets/css/# styles.css to the root directory
The admin folder seems to be their to handle images, javascript, and cascading style sheets.
I was wondering how it gets created and is it needed?
No directories get created “automatically”. All directories are created as a result of some command being issued. We would have no way of knowing how or why any directory was created for an existing project without knowing what commands were issued.
For the situation as you describe here for this assets directory is that it is possible that it was created as the result of a collectstatic command. (You would need to check the STATIC_ROOT to see if that gives you any indication along those lines. However, that is not definitive proof either way.)
There are some de facto “standards” or “conventions”, where you have a project directory where all files are stored. Inside that are directories with names that are usually something like the same as the project directory, and a directory for each app. Depending upon your project structure, you might also have directories for “templates” and “static” that are considered “project-level” resources.
Directories other than this, there’s no way for us to know.
These are some common defaults created by use of the startproject and startapp commands, but using them is not required. There are other tools such as cookiecutter that provide alternatives.