[Django] #34976: Feature request: startproject and startapp should provide feedback

9 views
Skip to first unread message

Django

unread,
Nov 18, 2023, 10:59:58 AM11/18/23
to django-...@googlegroups.com
#34976: Feature request: startproject and startapp should provide feedback
-------------------------------------+-------------------------------------
Reporter: Thibaud | Owner: nobody
Colas |
Type: New | Status: new
feature |
Component: Core | Version: dev
(Management commands) | Keywords: tutorial, command,
Severity: Normal | startproject, startapp
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-------------------------------------+-------------------------------------
Initially proposed on the [https://forum.djangoproject.com/t/feature-
request-startproject-and-startapp-should-provide-feedback/24073/1 Django
Forum – Feature request: startproject and startapp should provide
feedback], where this received 4 "likes" and 5 comments saying this was a
good enhancement.

> I’d like to propose adding a success message / feedback when running the
startproject and startapp commands. For people who are experienced devs it
might be expected that a successful script exists without any output. For
beginners, it can be very confusing.
>
> This shows up as an issue for people who go through Django tutorials, as
django-admin and startproject are often their first point of contact with
the framework after installing Django.
>
> From personal experience with Django Girls in particular, this is
causing a common issue where people won’t realise the command has worked
so will run it multiple times with different options (for example with or
without a destination folder), which leads to at best confusing error
messages, at worst multiple projects created within one-another.

== Output options

Based on the feedback in the forum, I’d recommend starting with the
simplest output of confirming the command worked and restating what
happened.

=== Success one-liner

For example, running:

{{{
django-admin startproject mysite
}}}

This would display be:

> Success! Created mysite at
/absolute/path/to/where/startproject/created/mysite

I think adding this to `startproject` or `startapp` would make for a great
PR (or two great PRs).

=== Files created

If the person taking this on has the skills, it’d be nice to also display
a recap of what files were created. This will be relevant for both
commands, and no matter what template was in use.

For example, running:

{{{
django-admin startproject mysite
}}}

We could show:

{{{
mysite
├── manage.py
└── mysite
├── __init__.py
├── asgi.py
├── settings.py
├── urls.py
└── wsgi.py
}}}

This could be a separate PR if this proves complex. And if this kind of
good-looking line art is too hard to do in Django, we could use simple
indentation instead:

{{{
mysite/
manage.py
mysite/
__init__.py
settings.py
urls.py
asgi.py
wsgi.py
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34976>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 18, 2023, 11:00:31 AM11/18/23
to django-...@googlegroups.com
#34976: Feature request: startproject and startapp should provide feedback
-------------------------------------+-------------------------------------
Reporter: Thibaud Colas | Owner: nobody
Type: New feature | Status: new
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: tutorial, command, | Triage Stage:
startproject, startapp | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Description changed by Thibaud Colas:

Old description:

New description:

Initially proposed on the [https://forum.djangoproject.com/t/feature-
request-startproject-and-startapp-should-provide-feedback/24073/1 Django
Forum – Feature request: startproject and startapp should provide
feedback], where this received 4 "likes" and 5 comments saying this was a
good enhancement.

> I’d like to propose adding a success message / feedback when running the
startproject and startapp commands. For people who are experienced devs it
might be expected that a successful script exists without any output. For
beginners, it can be very confusing.
>
> This shows up as an issue for people who go through Django tutorials, as
django-admin and startproject are often their first point of contact with
the framework after installing Django.
>
> From personal experience with Django Girls in particular, this is
causing a common issue where people won’t realise the command has worked
so will run it multiple times with different options (for example with or
without a destination folder), which leads to at best confusing error
messages, at worst multiple projects created within one-another.

== Output options

Based on the feedback in the forum, I’d recommend starting with the
simplest output of confirming the command worked and restating what
happened.

=== Success one-liner

For example, running:

{{{
django-admin startproject mysite
}}}

The command would display:

=== Files created

For example, running:

{{{
django-admin startproject mysite
}}}

We could show:

--

--
Ticket URL: <https://code.djangoproject.com/ticket/34976#comment:1>

Reply all
Reply to author
Forward
0 new messages