Re: [Django] #33650: Update startproject template with config directory (was: Update startproject template with config directory and custom user model)

2 views
Skip to first unread message

Django

unread,
Apr 17, 2022, 5:57:48 PM4/17/22
to django-...@googlegroups.com
#33650: Update startproject template with config directory
-------------------------------------+-------------------------------------
Reporter: Timothy Allen | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: startproject, | Triage Stage:
template | Someday/Maybe
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Someday/Maybe


Old description:

> I propose that we make makes two changes to the `startproject` template:
>
> * instead of putting configuration files such as `settings.py`,
> `wsgi.py`, and the root `urls.py` in `my_project/my_project`, use
> `my_project/config`
> * start the project with a custom User model app, `users`
>
> Over the years, I've taught or tutored over 100 Djangonauts starting
> their first project. These two pain points came up the most frequently.
> Having to explain and distinguish between two directories with the same
> name is a constant pain point in the teaching process - "cd into
> my_project ... no, the other one!"
>
> It is sometimes better to show rather than tell, so following our own
> documentation and including a custom User model with the initial project
> template reinforces the best practice that we explicitly point out in the
> documentation.

New description:

I propose that we change the `startproject` template to put configuration
files such as `settings.py`, `wsgi.py`, and the root `urls.py` in
`my_project/config` instead of `my_project/my_project`.

Over the years, I've taught or tutored over 100 Djangonauts starting their
first project. Having to explain and distinguish between two directories
with the same name is a constant pain point in the teaching process - "cd
into my_project ... no, the other one!"

--

Comment:

It would be better to first propose these ideas on the mailing list to
build consensus. And since the two ideas are independent, it would be
better to have two separate tickets. #27909 is already at "someday/maybe"
status regarding the custom user model, pending a discussion. I'll
repurpose this one to focus on changing the settings directory name. I'm
not sure if that's been proposed, but I found
[https://forum.djangoproject.com/t/django-new-project-structure-name/9987
a recent discussion on the forum]. I see you've already
[https://github.com/django/django/pull/15609 offered a patch].

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

Reply all
Reply to author
Forward
0 new messages