startproject with default app

61 views
Skip to first unread message

Luke Sapan

unread,
Dec 7, 2015, 12:24:19 PM12/7/15
to Django developers (Contributions to Django itself)

Hello,


I have a suggestion for an improvement to the startproject command. Currently, the command creates a project and a main folder that isn’t quite an app. It doesn’t have any models, views, tests, etc. I realize this is by design, and for many cases is the correct fit.


However, there are also many cases where you want to use that main folder as an app itself. While this is trivial (create apps.py, models.py, views.py, tests.py, migrations module and add <app name> into settings.py), it’s a bit repetitive and could certainly be streamlined with a flag passed to startproject. For example:

./manage.py startproject foo --app


There are many situations where using the primary folder as an app makes a great deal of sense, and optionally facilitating that style would certainly help projects get up and running that much faster.


Thank you for your consideration.

Florian Apolloner

unread,
Dec 7, 2015, 2:07:00 PM12/7/15
to Django developers (Contributions to Django itself)
Hi Luke,

this is what the --template argument is for, this way we do not need an extra flag for every user wish ;)

Cheers,
Florian

Luke Sapan

unread,
Dec 7, 2015, 2:29:57 PM12/7/15
to Django developers (Contributions to Django itself)
Well, that's embarassing. I totally missed that the template flag even existed. Thanks!
Reply all
Reply to author
Forward
0 new messages