We all know how easy it is to start a project in Django. After installing Django you just need to issue one command:
django-admin sartproject myproject
This will create a myproject directory in your current directory which will contain some initial settings, database configurations etc. and the structure is as follows:
Here you can see there is a myproject on top of all, which contains another myproject inside. This inside myproject will contain the settings and configurations.
Somehow I’ve developed a bit of compulsion towards this structure of myproject inside myproject. I wanted to rename this inside one as root or main or anything that doesn’t matches with the parent directory name. In the start I used to rename the myproject inside then change some line in the settings.py , manage.py and wsgi.py. It was not that difficult but I wanted Django to take care of that for me. And It’s very easy. You just need to issue one more command.
Let’s assume that you want to create a project that’s settings and configurations folder will be named as root. So first, you need to create a directory by yourself where the project will reside. Then run the same command as creating project, this time just specify the name of settings and configurations directory. Like this:
django-admin startproject root myproject
And the resultant structure is:
Does it looks and sounds better?