Django makes web development efficient, but its initial setup process involves running two commands:
django-admin startproject project_name
cd project_name
python manage.py startapp myapp
While simple, this two-step process could be streamlined into a single command. Imagine running: django-admin startprojectwithapp myproject myapp
This unified command would:
Create the project structure.
Automatically generate the first app.
The result? A ready-to-code project with less hassle:
I believe combining django-admin startproject and python manage.py startapp into a single command would simplify the Django setup process and make development more efficient. I got it wrong when I started with django. I want to know what you guys think
It is common for beginners to think that these two operations are joined or operate in parallel, but that’s not universally true.
You can run a Django installation without any user-written apps - where all apps being used are installed as packages. You’ll be running startproject only and never running startapp.
You may also be in a situation where you’re needing to create multiple apps for your project, and so want to run startapp multiple times without running startproject.
As a result of the effects of both of these situations, I believe it would be more confusing to add a third command to the mix.
Make a new command that will make it easier to choose the kind of project
The work is done in a pull request on the DEPs repository. For readers who are not familiar with them – DEPs, or Django Enhancement Proposals, are specifications for major things in Django – major changes, basic processes etc.
The suggestion is a work in progress (that’s why it’s still a pull request), but it’s meant to address @Brighht’s initial complaint/suggestion – to make it more straightforward to start with the common case for beginners, while still keeping tabs on the somewhat-less-common cases @KenWhitesell noted.