I’d like to propose adding a success message / feedback when running the
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
startproject are often their first point of contact with the framework after installing Django.
See for example:
- Django Girls – Your first Django project!
- Django’s own tutorial – Writing your first Django app, part 1
- MDN’s Django Tutorial Part 2: Creating a skeleton website
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.
As far as what success message / feedback to display, my personal recommendation would be to show a “success” one-liner, and then all files that were created with their folder structure, like a lot of tutorials do. For example the official tutorial shows:
mysite/ manage.py mysite/ __init__.py settings.py urls.py asgi.py wsgi.py
The “success” one-liner would be a good first step – perhaps just restating the command arguments in the past tense (“Successfully created <project_name> at <project_path>”).
For example, Next.js has a great one-liner and then a good intro to available commands. Run:
npx create-next-app@latest nextjs-blog --use-npm --example "https://github.com/vercel/next-learn/tree/main/basics/learn-starter"
Success! Created nextjs-blog at /Users/thibaudcolas/Dev/djangogirls/nextjs-blog Inside that directory, you can run several commands: npm run dev Starts the development server. npm run build Builds the app for production. npm start Runs the built app in production mode. We suggest that you begin by typing: cd nextjs-blog npm run dev
startapp, I would say the exact same applies where stating the command worked and showing the output would help with people’s understanding of what they are doing.