Opened 3 years ago

Last modified 21 hours ago

#34976 assigned New feature

startproject and startapp should provide feedback

Reported by: Thibaud Colas Owned by: Vaibhav Pant
Component: Core (Management commands) Version: dev
Severity: Normal Keywords: tutorial, command, startproject, startapp
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: yes

Description (last modified by Thibaud Colas)

Initially proposed on the 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:

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

Change History (26)

comment:1 by Thibaud Colas, 3 years ago

Description: modified (diff)

comment:2 by Mariusz Felisiak, 3 years ago

Summary: Feature request: startproject and startapp should provide feedbackstartproject and startapp should provide feedback
Triage Stage: UnreviewedAccepted
Type: New featureCleanup/optimization

comment:3 by Abhay Vachhani, 3 years ago

Owner: changed from nobody to Abhay Vachhani
Status: newassigned

Assigned ticket to Abhay Vachhani

comment:4 by Mariusz Felisiak, 3 years ago

Has patch: set
Needs tests: set
Patch needs improvement: set

comment:5 by Salvo Polizzi, 3 years ago

Needs tests: unset
Owner: changed from Abhay Vachhani to Salvo Polizzi

comment:6 by Salvo Polizzi, 3 years ago

Patch needs improvement: unset

comment:8 by Mariusz Felisiak, 3 years ago

Patch needs improvement: set

comment:9 by Salvo Polizzi, 3 years ago

Patch needs improvement: unset

comment:10 by Mariusz Felisiak, 3 years ago

Patch needs improvement: set

comment:11 by Salvo Polizzi, 3 years ago

Patch needs improvement: unset

comment:12 by Mariusz Felisiak, 3 years ago

Needs tests: set

comment:13 by Thibaud Colas, 3 years ago

Follow-up PR by @TobeTek with directory structure output: Refs #34976 -- Print directory structure after startapp and startproject #17838

comment:14 by Natalia Bidart, 2 years ago

Patch needs improvement: set

comment:15 by Salvo Polizzi, 2 years ago

Needs tests: unset
Patch needs improvement: unset

comment:16 by Sarah Boyce, 2 years ago

Patch needs improvement: set

comment:17 by Sarah Boyce, 2 years ago

Note that we need the accessibility team to review the tree structure proposal. It has been raised this may not be accessible for speech and braille users.
Still happy to have a success message, but -1 on adding something that would exclude users. I have added a similar comment in the forum discussion 👍

comment:18 by Sarah Boyce, 20 months ago

Suggestion from #36113, which I like in the startapp case:

  • Provide a log message or output suggesting the exact string to add to INSTALLED_APPS, e.g.,:
    $ user@host: proj % django-admin startapp user apps/dashboard/user
    App added to following directory : `apps.dashboard.user` 
    To integrate this app with your project, please add the following line in your `settings.INSTALLED_APPS`.
    """
    INSTALLED_APPS = [
        ...,
        'apps.dashboard.user.apps.AppsDashboardUserConfig',
        ...,
    ]
    """
    
    $ user@host: proj % 
    

comment:19 by Vaibhav Pant, 4 months ago

Hey, I’m a beginner contributor and I’ve gone through the ticket discussion, forum thread, and related PRs before working on this.

Based on the discussion, I focused on a minimal implementation for the success feedback message instead of the directory tree output.

Currently, I have:

  • added a success message after successful creation,
  • added a verbosity check (verbosity >= 1),
  • updated the related tests in tests/admin_scripts/tests.py.

Example output:

Success! Created project "mysite" at "/path/to/mysite".

Before opening a PR, I wanted to ask if this approach looks correct or if there are any additional changes/tests that would be preferred for this ticket.

Thanks!

comment:20 by Vaibhav Pant, 4 months ago

Owner: changed from Salvo Polizzi to Vaibhav Pant

comment:21 by Vaibhav Pant, 4 months ago

Patch needs improvement: unset

comment:23 by Jacob Walls, 22 hours ago

Triage Stage: AcceptedReady for checkin

comment:24 by Jacob Walls, 22 hours ago

Reviewed with a group at DjangoCon US 2026. The minimal suggestion to add a success message is ready to land.

The other follow-up ideas (tree of files, next steps messaging) raise a few more questions (do we want additional messaging?), so perhaps better than leaving this ticket open would be to continue discussion on the forum.

comment:25 by Jacob Walls, 22 hours ago

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

Test failures after rebasing.

comment:26 by Jacob Walls, 21 hours ago

Needs documentation: set
Type: Cleanup/optimizationNew feature
Note: See TracTickets for help on using tickets.
Back to Top